~siborgium/src-tree

c8797cd410c065e952d20b96c5237b70e68680de — Sergey Smirnykh 1 year, 9 months ago e98200e
Pretty-print command choices
1 files changed, 7 insertions(+), 1 deletions(-)

M src-tree
M src-tree => src-tree +7 -1
@@ 44,13 44,19 @@ class SrcTree(object):
            prog = 'src-tree',
            description = 'A simple script to setup and build source tree',
            usage = 'src-tree <command> [<args>]')
        parser.add_argument('command')

        group = parser.add_argument_group(title = 'Command',
                                          description = 'Command to be executed on source tree')
        group.add_argument('command',
                            choices = ['clone', 'checkout', 'link'],
                            help = 'See the \'--help\' output of each particular command')

        args = parser.parse_args(sys.argv[1:2])
        if args.command is None:
            print('Unrecognized command')
            parser.print_help()
            exit(1)

        getattr(self, args.command)()

    def _parse_args(self, parser):