From f5c3cef173fbfa098ff1fc1bee1c7f9d3049e802 Mon Sep 17 00:00:00 2001 From: Martin Baeuml Date: Wed, 14 Sep 2011 18:25:57 +0200 Subject: [PATCH] fix handling of subcommands (fixes #51) --- sloth/core/cli.py | 2 +- sloth/core/labeltool.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sloth/core/cli.py b/sloth/core/cli.py index 87f1b57..d2c7103 100644 --- a/sloth/core/cli.py +++ b/sloth/core/cli.py @@ -196,7 +196,7 @@ class LaxOptionParser(OptionParser): """ An option parser that doesn't raise any errors on unknown options. - This is needed because the --settings and --pythonpath options affect + This is needed because the --config and --pythonpath options may affect the commands (and thus the options) that are available to the user. """ def error(self, msg): diff --git a/sloth/core/labeltool.py b/sloth/core/labeltool.py index de6d49f..8b16e70 100755 --- a/sloth/core/labeltool.py +++ b/sloth/core/labeltool.py @@ -101,7 +101,6 @@ class LabelTool(QObject): option_list=BaseCommand.option_list) try: options, args = parser.parse_args(self.argv) - handle_default_options(options) except: pass # Ignore any option errors at this point. @@ -121,7 +120,7 @@ class LabelTool(QObject): # check for commands try: - subcommand = self.argv[1] + subcommand = args[1] except IndexError: subcommand = None