View Code? Open in Web Editor
NEW
Yet another cli library , click-like but sub-command friendly and designed for cli auto-generating.
License: MIT License
Python 99.23%
Shell 0.14%
Makefile 0.63%
cmdtree's People
cmdtree's Issues
@command("run")
@argument("script_path", help="file path of python script")
@option("feed", type=Choices(("kline", "fake")), default="fake")
@option("config", help="config file path for kline database")
def hello(xxxxx):
pass
This order may cause following error:
Traceback (most recent call last):
File "engine_fc/shortcuts.py", line 42, in <module>
entry()
File "build/bdist.linux-x86_64/egg/cmdtree/registry.py", line 16, in entry
File "build/bdist.linux-x86_64/egg/cmdtree/parser.py", line 62, in run
TypeError: 'CmdProxy' object is not callable
@command("run")
@option("kline", type=Choices(("kline", "fake")))
@argument("script_path", help="file path of python _script")
def run_test(script_path):
pass
This order cause the positional argument "script_path" missing.
This order works well:
@command("run")
@argument("script_path", help="file path of python _script")
@option("kline", type=Choices(("kline", "fake")))
def run_test(script_path):
pass