From cbd0080c1f77fd24dd9328402c98f6ad726cc19d Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Wed, 17 Dec 2014 01:01:39 +0100 Subject: todo: Move file parsing to top of parse_args --- todo | 18 +++++++++--------- 1 file 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['']: config.todo_file = args[''] 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): -- cgit v1.2.3-70-g09d2