Skip to main content

Parse command line arguments made easier...

Project description




𝘼𝙍𝙂 : Parse command line arguments made easier...

Install

pip install arg

Usage

$ 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

API

arg()

Return an array with the arguments without the file name

Return Type: list

.v()

Return an array with all the arguments. (arg.v ~> argv Argumet Vector)

Return Type: list

.c()

Return an array with all the arguments. (arg.c ~> argc Argument Count)

Return Type: int

.s()

Return an string with all the arguments. (arg.s ~> Arguments to String)

Return Type: str

.fileName()

Return an string with the name of the file

Return Type: str

.at(n)

Return the value of the argument at value at n

Return Type: str

Related

  • lupe: A better CLI Helper.

Team

Carlos Abraham Logo
Carlos Abraham

License

MIT License © Carlos Abraham

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for arg, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size arg-0.0.1-py3-none-any.whl (2.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size arg-0.0.1.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page