It is a modern args catching with python3 and OOP structure and implementation.
Project description
Why SmileArgs
It is a modern args catching with python3 and OOP structure and implementation.
Optional
Some parameters will clarify more, when instance starting
smile = SmileArgs(allowNoValue= False, duplicated= False, console= True, debug= False)
- allowNoValue: bool= False | True
- No require value on args
- -c command does not need any assign value (Ex: python test.py -c)
- duplicated: bool= False | True
- Allowing a user types many times of any command on args (Ex: python test.py -b -b -b)
- Will execute 3 times of the command "-b" regarding to the above example
- console: bool= False | True
- A method will print error when the system catches and throw a particular error
- debug bool= False | True
- This property will track any prompt while working
Example
create a test.py
from SmileArgs import SmileArgs
smile = SmileArgs()
smile.addCommand('a', 'alphabet', 'show alphabet')
smile.addCommand('b', 'barbie', 'Wow, movies')
smile.addCommand('m', 'miss', 'miss mom everyday')
smile.run()
cli
$ python test.py -a -ab -a --miss=mom
it will catch '-a' as a short command, and '--miss' as a long command; then use match or if statement to control those states.
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
SmileArgs-1.0.0.tar.gz
(2.7 kB
view hashes)
Built Distribution
Close
Hashes for SmileArgs-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95f54c8199d2574b30bf320df654c7b7ca40ed7d04af36af3af08754359b02dc |
|
MD5 | 1948b82066d320d07e96798c47cc7f1e |
|
BLAKE2b-256 | b666eeb592c32329365d282598d7c2e0cf59694276eeded54a9187c7aa481e18 |