nargs=* equivalent for options in Click
One way to approach what you are after is to inherit from click.Option, and customize the parser. Custom Class: import click class OptionEatAll(click.Option): def __init__(self, *args, **kwargs): self.save_other_options = kwargs.pop(‘save_other_options’, True) nargs = kwargs.pop(‘nargs’, -1) assert nargs == -1, ‘nargs, if set, must be -1 not {}’.format(nargs) super(OptionEatAll, self).__init__(*args, **kwargs) self._previous_parser_process = None self._eat_all_parser = … Read more