From 4c5d0003ca3cace64ea780ca4121c46487b5899e Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Sat, 19 Feb 2011 00:12:42 +0100 Subject: Fix "fedpkg help" command (make it work again) This changes the parser_help command to a lambda which passes the parser variable to the usage() function as a second parameter. We forgot to give the usage() function its "parser" parameter, and after we moved the definition of the parser variable out of the main module, the usage() function did not see the parser variable any more. --- src/fedpkg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fedpkg.py b/src/fedpkg.py index cb289a6..9e78a28 100755 --- a/src/fedpkg.py +++ b/src/fedpkg.py @@ -141,7 +141,7 @@ class TaskWatcher(object): return koji.TASK_STATES[info['state']].lower() # Add a simple function to print usage, for the 'help' command -def usage(args): +def usage(args, parser): parser.print_help() # Define our stub functions @@ -890,7 +890,7 @@ def parse_cmdline(generate_manpage = False): # Set up the various actions # Add help to -h and --help parser_help = subparsers.add_parser('help', help = 'Show usage') - parser_help.set_defaults(command = usage) + parser_help.set_defaults(command = lambda args: usage(args, parser=parser)) # Add a common build parser to be used as a parent parser_build_common = subparsers.add_parser('build_common', -- cgit