Skip to content

Wrapper to argparser which simplify creating command line interfaces.

License

Notifications You must be signed in to change notification settings

boatx/command_manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Command Manager

Wrapper around argparser to simplify creating command line interfaces.

Installation

python setup.py install

Example

Use option decorator to create sub command which execute decorated function.

from command_manager import Manager


manager = Manager()

@manager.option('--test', type=int)
def sub_command1(test):
    print(test)

@manager.option('--file', dest='file_name', type=str)
def sub_command2(file_name):
    print('File {}'.format(file_name))


if __name__ == '__main__':
    manager.run_command()
python main.py sub_command1 --test 4
python main.py sub_command2 --file test.txt

About

Wrapper to argparser which simplify creating command line interfaces.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages