summaryrefslogtreecommitdiffstats
path: root/src/fedpkg.py
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2011-02-19 00:12:42 +0100
committerHans Ulrich Niedermann <hun@n-dimensional.de>2011-02-19 00:12:42 +0100
commit4c5d0003ca3cace64ea780ca4121c46487b5899e (patch)
tree504fc46f70ad353791920b2535ed1447c711ae4a /src/fedpkg.py
parentd9bcb58385f9bb03f6ceb2390b29f25d5951fe8c (diff)
downloadfedora-packager-4c5d0003ca3cace64ea780ca4121c46487b5899e.tar.gz
fedora-packager-4c5d0003ca3cace64ea780ca4121c46487b5899e.tar.xz
fedora-packager-4c5d0003ca3cace64ea780ca4121c46487b5899e.zip
Fix "fedpkg help" command (make it work again)fix-help-command
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.
Diffstat (limited to 'src/fedpkg.py')
-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',