@@ 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):