diff options
author | W. Trevor King <wking@drexel.edu> | 2008-12-04 11:56:34 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2008-12-04 11:56:34 -0500 |
commit | 2447b5df014630d402f1fe28db6898a981f5ada0 (patch) | |
tree | 4d3516a312c7f2d200dfd93a7c66fbf98a3c5451 /libbe | |
parent | b5b8d7214b24338ba5c97287810a4a67e61c3c06 (diff) | |
download | bugseverywhere-2447b5df014630d402f1fe28db6898a981f5ada0.tar.gz |
becommands/severity and status now handle --complete appropriately.
I also disabled interspersed options and arguments in
cmdutils.CmdOptionParser. See
http://docs.python.org/library/optparse.html
Now
$ be severity xyz --complete
returns available severities. It had previously returned
--help --complete
Diffstat (limited to 'libbe')
-rw-r--r-- | libbe/cmdutil.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libbe/cmdutil.py b/libbe/cmdutil.py index eefed58..6be7540 100644 --- a/libbe/cmdutil.py +++ b/libbe/cmdutil.py @@ -97,11 +97,13 @@ def raise_get_help(option, opt, value, parser): raise GetHelp def raise_get_completions(option, opt, value, parser): + print "got completion arg" raise GetCompletions(completions(sys.argv[1])) class CmdOptionParser(optparse.OptionParser): def __init__(self, usage): optparse.OptionParser.__init__(self, usage) + self.disable_interspersed_args() self.remove_option("-h") self.add_option("-h", "--help", action="callback", callback=raise_get_help, help="Print a help message") |