命令行界面构建工具:Docopt
jopen
10年前
Docopt。抛弃optparse和argparse吧,使用docstrings来构建优雅的,可读性强的,并且复杂(如果你需要的话)的命令行界面。Docopt 提供多种语言版本,包括:Java、Python、PHP、C/C++、.NET、D语言、Scala、Go 语言等,详细列表请看 https://github.com/docopt/
Naval Fate. Usage: naval_fate ship new <name>... naval_fate ship <name> move <x> <y> [--speed=<kn>] naval_fate ship shoot <x> <y> naval_fate mine (set|remove) <x> <y> [--moored|--drifting] naval_fate -h | --help naval_fate --version Options: -h --help Show this screen. --version Show version. --speed=<kn> Speed in knots [default: 10]. --moored Moored (anchored) mine. --drifting Drifting mine.