A Handy Package to Parse Command-Line Arguments
Project description
0xFlags
A Handy Package to Parse Command-Line Arguments
Installation :
From pip :
pip3 install oxflags
From source :
git clone https://github.com/0x68616469/oxflags/
Requirements :
oxansi oxtables (downloaded automatically with pip)
Example :
from oxflags import Flag
flag = Flag(description="A Handy Package to Parse Command-Line Arguments, made by @0x68616469")
flag.new(short="-e", full="--example", type="string", default="Default string", help="Description/Usage")
flag.new(full="--age", required=True, type="int", default=None)
flag.new(short="-y", full="--yes", type="bool")
flag.parse()
print(f"Example: {flag.example}")
print(f"Age : {flag.age}")
print(f"Yes : {flag.yes}")
# $ python3 test.py --age 10 -y
# Example: Default string
# Age : 10
# Yes : True
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
oxflags-0.0.5.tar.gz
(2.9 kB
view hashes)