This repository was archived by the owner on Oct 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpn.1
More file actions
87 lines (77 loc) · 2.81 KB
/
pn.1
File metadata and controls
87 lines (77 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
.TH PN 1
.SH NAME
pn - a command-line tool for phone number manipulation
.SH SYNOPSIS
.B pn
.I COMMAND
[\fIOPTIONS\fR]
.I INPUT
.SH COMMANDS
.TP
.B valid
Tests whether the phone number given as \fIINPUT\fR is a valid number or short
number. Returns \fB0\fR (SUCCESS) if the number is valid, \fB1\fR (ERROR)
otherwise. Valid options: \fB-c\fR, \fB-v\fR (verbose, default off).
.TP
.B info
Displays informations about the phone number given as \fIINPUT\fR. Valid
option: \fB-c\fR.
.TP
.B format
Formats a telephone number given as \fIINPUT\fR to the specified standard
(E164 by default), result on stdout. Valid options: \fB-c\fR, \fB-f\fR.
.TP
.B find
Finds phone number in some text given as \fIINPUT\fR, result on stdout (one
line per number found). Valid options: \fB-c\fR, \fB-f\fR, \fB-l\fR.
.TP
.B dialout
Formats a phone number given as \fIINPUT\fR in \fBe164\fR format for
out-of-country dialing purposes. Valid options: \fB-c\fR, \fB-l\fR.
.SH OPTIONS
.TP
\fB-c\fR \fICOUNTRY\-CODE\fR
If set, the phone number(s) given in \fIINPUT\fR will be considered as being
dialed from the country specified by the 2 uppercase letters
\fICOUNTRY\-CODE\fR (e.g. "FR", "US", ...). If this option is not set,
\fBpn\fR will look for numbers in the international format.
.TP
\fB-f\fR \fIFORMAT\fR
Sets the phone number output format. \fIFORMAT\fR must be one of \fBe164\fR,
\fBint\fR (international), \fBnat\fR (national), or \fBteluri\fR (RFC3966 tel
URI). The default value is \fBe164\fR.
.TP
\fB-l\fR \fILENIENCY\fR
Sets the phone number search leniency in \fIINPUT\fR. \fILENIENCY\fR must be
one of:
.RS
.TP
.B possible
Phone numbers accepted are possible, but not necessarily valid.
.TP
.B valid
(default value) Phone numbers accepted are possible and valid. Numbers written
in national format must have their national-prefix present if it is usually
written for a number of this type.
.TP
.B strict
Phone numbers accepted are valid and are grouped in a possible way for this
locale. For example, a US number written as "65 02 53 00 00" and "650253 0000"
are not accepted at this leniency level, whereas "650 253 0000", "650 2530000"
or "6502530000" are. Numbers with more than one '/' symbol in the national
significant number are also dropped at this level.
.TP
.B exact
Phone numbers accepted are valid and are grouped in the same way that we would
have formatted it, or as a single block. For example, a US number written as
"650 2530000" is not accepted at this leniency level, whereas "650 253 0000" or
"6502530000" are. Numbers with more than one '/' symbol are also dropped at
this level.
(see https://javadoc.io/doc/com.googlecode.libphonenumber/libphonenumber/8.4.1
for more details)
.RE
.SH RETURN STATUS
\fBpn\fR returns 0 on successful operations, 1 if an error occurred (option
error, parsing error).
.SH AUTHOR
Camille Oudot <camille.oudot@orange.com>