From 7a28ec601e5da452f6f8395b8f809acd89bbea19 Mon Sep 17 00:00:00 2001 From: Zane Bitter <zbitter@redhat.com> Date: Mon, 14 May 2012 17:56:33 +0200 Subject: [PATCH] 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 <zbitter@redhat.com> --- bin/heat | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/heat b/bin/heat index e574ff1d7d..b67d824e45 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):