summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2011-02-19 00:12:42 +0100
committerJesse Keating <jkeating@redhat.com>2011-03-03 13:25:06 -0700
commitc87ee26fe677173c684fc65e198d0daf24266954 (patch)
tree529e7ff64af6050b0b65fd95e29e4ffc3e195cee
parentf70fd842a7ea286ae88aed06bba229b651218ad2 (diff)
downloadfedora-packager-c87ee26fe677173c684fc65e198d0daf24266954.tar.gz
fedora-packager-c87ee26fe677173c684fc65e198d0daf24266954.tar.xz
fedora-packager-c87ee26fe677173c684fc65e198d0daf24266954.zip
Fix "fedpkg help" command (make it work again) (#681242)
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.
-rwxr-xr-xsrc/fedpkg.py4
1 files 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',