From: Zane Bitter Date: Mon, 14 May 2012 15:56:33 +0000 (+0200) Subject: Make 'heat help' show a list of commands X-Git-Tag: 2014.1~1827 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=7a28ec601e5da452f6f8395b8f809acd89bbea19;p=openstack-build%2Fheat-build.git Make 'heat help' show a list of commands Previously we just printed an error message about not specifying a command to get help about, and no hint about how to work out which commands even existed. Signed-off-by: Zane Bitter --- diff --git a/bin/heat b/bin/heat index e574ff1d..b67d824e 100755 --- a/bin/heat +++ b/bin/heat @@ -434,14 +434,14 @@ def print_help(options, args): """ Print help specific to a command """ - if len(args) != 1: - sys.exit("Please specify a command") - parser = options.__parser - command_name = args.pop() - command = lookup_command(parser, command_name) - print command.__doc__ % {'prog': os.path.basename(sys.argv[0])} + if not args: + parser.print_usage() + + subst = {'prog': os.path.basename(sys.argv[0])} + docs = [lookup_command(parser, cmd).__doc__ % subst for cmd in args] + print '\n\n'.join(docs) def lookup_command(parser, command_name):