mirror of
https://github.com/wassname/sloth.git
synced 2026-07-01 23:33:49 +08:00
fix handling of subcommands (fixes #51)
This commit is contained in:
+1
-1
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user