𝘼𝙍𝙂
: Parse command line arguments made easier...
pip install arg
$ python test.py ford -m mustang --year 2017 red
test.py
import arg
# argv without file name
print(arg())
# => ['ford', '-m', 'mustang', '--year', '2017', 'red']
# argv
print(arg.v())
# => ['test.py', 'ford', '-m', 'mustang', '--year', '2017', 'red']
# argc
print(arg.c())
# => 7
# args as string
print(arg.s())
# => test.py ford -m mustang --year 2017 red
# file name
print(arg.fileName())
# => test.py
# argument at n
print(arg.at(2))
# => -m
Return an array with the arguments without the file name
Return Type: list
Return an array with all the arguments. (arg.v ~> argv Argumet Vector)
Return Type: list
Return an array with all the arguments. (arg.c ~> argc Argument Count)
Return Type: int
Return an string with all the arguments. (arg.s ~> Arguments to String)
Return Type: str
Return an string with the name of the file
Return Type: str
Return the value of the argument at value at n, otherwise 404
Return Type: str
- lupe: A better CLI Helper.
Carlos Abraham |
MIT License © Carlos Abraham