PN(1)

πŸ“¦ version 0.9.0, in alpine 3.24

πŸ¦‹ PN(1) β€” the pn page, but make it make sense

okay so real talk: this is pn from section 1 of the General Commands Manual, and she is a whole command-line tool for phone number manipulation πŸ’… bestie you're gonna love her.


✨ NAME ✨

pn β€” a command-line tool for phone number manipulation πŸŽ€


🌸 SYNOPSIS 🌸

pn COMMAND [OPTIONS] INPUT

like. command first. then options. then the actual input. that's the vibe πŸ‘‘


πŸ’– COMMANDS πŸ’–

  • valid β€” tests whether the phone number you passed as INPUT is a valid number or a valid short number ✨. Returns 0 (SUCCESS) if the number is valid, 1 (ERROR) otherwise. Valid options here: -c, -v (verbose, default off).
  • info β€” displays informations about the phone number given as INPUT 🧚 valid option: -c only.
  • format β€” formats the telephone number given as INPUT to the standard you specify (E164 by default 😌), result lands on stdout. Valid options: -c, -f.
  • find β€” finds phone number(s) inside some text given as INPUT, result on stdout (one line per number found πŸ”). Valid options: -c, -f, -l.
  • dialout β€” formats the phone number given as INPUT in e164 format, for out-of-country dialing purposes 🌈 valid options: -c, -l.

πŸ”₯ OPTIONS πŸ”₯

  • -c COUNTRY-CODE β€” if you set this, the phone number(s) in INPUT get treated as if they were dialed from the country given by the 2 uppercase letters COUNTRY-CODE (e.g. "FR", "US", ...) 🌍 if you don't set it, pn goes looking for numbers in the international format instead. no cap.
  • -f FORMAT β€” sets the phone number output format. FORMAT has to be one of e164, int (international), nat (national), or teluri (RFC3966 tel URI) πŸŽ€ the default value is e164.
  • -l LENIENCY β€” sets the phone number search leniency in INPUT. LENIENCY has to be one of these icons-only-iykyk levels:
    • 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's usually written for a number of this type. read that twice, it matters.
    • strict β€” phone numbers accepted are valid and 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. also: numbers with more than one / symbol in the national significant number get dropped at this level πŸ’€
    • exact β€” phone numbers accepted are valid and grouped 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 β€” yes it's a libphonenumber thing, go read it, it ate πŸ‘‘


πŸ‘‘ RETURN STATUS πŸ‘‘

pn returns 0 on successful operations, and 1 if an error occurred (option error, parsing error) 😭 that's it, that's the whole status situation.


πŸ“ AUTHOR πŸ“

Camille Oudot <camille.oudot@orange.com> β€” icon, legend, the blueprint πŸ’œ


lowkey a heads up bestie: pn only exists on this page as section 1 of the General Commands Manual β€” and the footer is just PN(1) again with no version or date attached anywhere πŸ™ˆ so if you were waiting for a copyright line… there isn't one. bye bestie, go format some numbers πŸŒΈπŸ¦‹βœ¨
πŸ“¦ where this page comes from