Skip to main content

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

Follow me

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)

Uploaded Source

Built Distribution

oxflags-0.0.5-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page