def argument(self, *args, **kwargs):
"""
Registers a click.argument which falls back to a configmanager Item
if user hasn't provided a value in the command line.
Item must be the last of ``args``.
"""
if kwargs.get('required', True):
raise TypeError(
'In click framework, arguments are mandatory, unless marked required=False. '
'Attempt to use configmanager as a fallback provider suggests that this is an optional option, '
'not a mandatory argument.'
)
args, kwargs = _config_parameter(args, kwargs)
return self._click.argument(*args, **kwargs)
评论列表
文章目录