是否有用于执行 gem/git样式命令行参数的Python模块?我的意思是gem/git风格是:
$ ./MyApp.py
The most commonly used MyApp commands are:
add Add file contents to the index
bisect Find by binary search the change that introduced a bug
branch List, create, or delete branches
checkout Checkout a branch or paths to the working tree
...
$ ./MyApp.py branch
* current-branch
master
Run Code Online (Sandbox Code Playgroud)
没有参数,输出会告诉您如何继续.还有一个特殊的"帮助"命令:
$ ./MyApp.py help branch
Run Code Online (Sandbox Code Playgroud)
这将为您提供有关"分支"命令的更深入的提示.
编辑: 通过执行我的意思是它为您执行使用打印,退出无效输入,根据您的CLI规范运行您的功能.为命令行排序"URL映射器".