aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2014-12-17 01:01:39 +0100
committerJohannes Löthberg <johannes@kyriasis.com>2014-12-17 01:01:39 +0100
commit581dc997753f8b2c1f8b4d152045112d5a9dbf04 (patch)
treecc688b434781f1629480370e2d8454ff638ead5b
parenta9731a40169cd50e407e60dc12f67b4ad468754a (diff)
downloadbin-581dc997753f8b2c1f8b4d152045112d5a9dbf04.tar.xz
todo: Move file parsing to top of parse_args
-rwxr-xr-xtodo18
1 files changed, 9 insertions, 9 deletions
diff --git a/todo b/todo
index d0a09a3..5dbde8d 100755
--- a/todo
+++ b/todo
@@ -48,15 +48,6 @@ class Config():
def parse_args(args):
config = Config()
- if args['--id']:
- config.sort_key = 'id'
- elif args['--date']:
- config.sort_key = 'date'
- else:
- config.sort_key = 'priority'
-
- config.reverse = args['--reverse']
-
if args['<file>']:
config.todo_file = args['<file>']
else:
@@ -67,6 +58,15 @@ def parse_args(args):
home_dir = path.expanduser('~')
config.todo_file = home_dir + '/.local/share/todo.toml'
+ if args['--id']:
+ config.sort_key = 'id'
+ elif args['--date']:
+ config.sort_key = 'date'
+ else:
+ config.sort_key = 'priority'
+
+ config.reverse = args['--reverse']
+
return config
def color_bold(text):