Python中的gem/gitstyle命令行参数

2024-04-29 04:32:56 发布

您现在位置:Python中文网/ 问答频道 /正文

是否有一个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映射器”进行排序。


Tags: 模块ortheto命令行pygit命令