Commit cd36b0a3 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Guard access to argv, fallback to the default action.

parent 05dbbf38
...@@ -105,9 +105,10 @@ class Application(object): ...@@ -105,9 +105,10 @@ class Application(object):
except Exception: except Exception:
pass # TODO pass # TODO
subcommand = Config.DEFAULT_ACTION try:
if len(sys.argv):
subcommand = sys.argv[1] subcommand = sys.argv[1]
except IndexError:
subcommand = Config.DEFAULT_ACTION
if subcommand == 'add': if subcommand == 'add':
self.add() self.add()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment