是否有一个Python模块用于执行gem/git风格的命令行参数?我所说的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
如果没有参数,输出将告诉您如何继续。还有一个特殊的“帮助”命令:
$ ./MyApp.py help branch
这会让你得到关于“branch”命令的更深入的提示。
编辑: 我的意思是它为您打印用法,以无效输入退出,根据您的CLI规范运行您的函数。对命令行的“URL映射器”进行排序。
目前没有回答
相关问题 更多 >
编程相关推荐