def each_command(): parser = get_argparser() # We're doing some wacky inspection here, let's make sure things are sane subparsers, = [ action for action in parser._actions if isinstance(action, argparse._SubParsersAction) ] choices = tuple(subparsers.choices) assert choices assert 'local-run' in choices return choices
def each_command(): parser = get_argparser() # We're doing some wacky inspection here, let's make sure things are sane subparsers, = [ action for action in parser._actions if isinstance(action, argparse._SubParsersAction) ] # Remove our dummy help command, paasta help --help is nonsense choices = tuple(set(subparsers.choices) - {'help'}) assert choices assert 'local-run' in choices return choices