【发布时间】:2017-03-29 00:34:01
【问题描述】:
默认argparse帮助输出很难看:
usage: gl.EXE [-h] [--version]
{track,untrack,status,diff,commit,branch,tag,checkout,merge,resolve,fuse,remote,publish,switch,init,history}
...
Gitless - a version control system built on top of Git - http://gitless.com
optional arguments:
-h, --help show this help message and exit
--version show program's version number and exit
subcommands:
{track,untrack,status,diff,commit,branch,tag,checkout,merge,resolve,fuse,remote,publish,switch,init,history}
track start tracking changes to files
untrack stop tracking changes to files
status show status of the repo
...
如何将输出格式化为与下面的示例完全相同。保留命令顺序
Gitless - a version control system built on top of Git - http://gitless.com
commands:
track start tracking changes to files
untrack stop tracking changes to files
status show status of the repo
...
【问题讨论】: