argparse参数叙述描述

时间:2017-06-24 20:28:23

标签: python python-3.x command-line-interface argparse

我正在使用argparse和这段代码

parser = argparse.ArgumentParser()
parser.add_argument('-c', '--client', nargs='*', action='store', help='Client mode, connect to [ hostname/address or localhost | port or 8080 | protocol or TCP ]')

在帮助页面上显示了这个

  -c [CLIENT [CLIENT ...]], --client [CLIENT [CLIENT ...]]
                        Client mode, connect to [ hostname/address or
                        localhost | port or 8080 | protocol or TCP ]

我怎样才能让它更像下列?

  -c [host [port]], --client [host [port]]
                        Client mode, connect to [ hostname/address or
                        localhost | port or 8080 | protocol or TCP ]

0 个答案:

没有答案