logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

pnc - a command-line tool for phone number manipulation

Author

       pnc   is   a   fork   of   pn   <https://github.com/Orange-OpenSource/pn>   written   by   Camille  Oudot
       <camille.oudot@orange.com>

       pnc  is  maintained  by  the  Sxmo  project:  <https://sxmo.org>.  You  can  find  the  source  code   at
       <https://sxmo.org/source>

Commands

valid  Tests  whether  the  phone  number  given  as  INPUT  is a valid number or short number. Returns 0
              (SUCCESS) if the number is valid, 1 (ERROR) otherwise. Valid options:  -c,  -v  (verbose,  default
              off).

       info   Displays information about the phone number given as INPUT. Valid option: -c.

       format Formats  a  telephone number given as INPUT to the specified standard (E164 by default), result on
              stdout. Valid options: -c, -f.

       find   Finds phone number in some text given as INPUT, result on stdout  (one  line  per  number  found).
              Valid options: -c, -f, -l.

       dialout
              Formats  a  phone  number given as INPUT in e164 format for out-of-country dialing purposes. Valid
              options: -c, -l.

Name

       pnc - a command-line tool for phone number manipulation

Options

-cCOUNTRY-CODE
              If set, the phone number(s) given in INPUT will be considered as being  dialed  from  the  country
              specified  by  the 2 uppercase letters COUNTRY-CODE (e.g.  "FR", "US", ...). If this option is not
              set, pnc will look for numbers in the international format.

       -fFORMAT
              Sets the phone number output format.  FORMAT  must  be  one  of  e164,  int  (international),  nat
              (national), or teluri (RFC3966 tel URI). The default value is e164.

       -lLENIENCY
              Sets the phone number search leniency in INPUT. LENIENCY must be one of:

              possible
                     Phone numbers accepted are possible, but not necessarily valid.

              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.

              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.

              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)

Return Status

pnc returns 0 on successful operations, 1 if an error occurred (option error, parsing error).

Synopsis

pncCOMMAND [OPTIONS] INPUT

See Also