'?'. One argument will be consumed from the command line if possible, and produced as a single item. If no command-line argument is present, the value from default will be produced. Note that for optional arguments, there is an additional case - the option string is present but not followed by a command-line argument. In this case the value from const will be produced. Some examples to illustrate this:
nargs是否可以设置为?在
在您的例子中,您使用了一个可选参数,因此当没有提供地址时,将使用const中的值。如果参数完全丢失,则使用default中的值。例如
^{pr2}$相关问题 更多 >
编程相关推荐