diff options
author | Johannes Löthberg <johannes@kyriasis.com> | 2014-12-17 01:01:39 +0100 |
---|---|---|
committer | Johannes Löthberg <johannes@kyriasis.com> | 2014-12-17 01:01:39 +0100 |
commit | cbd0080c1f77fd24dd9328402c98f6ad726cc19d (patch) | |
tree | e04bb0b74fc48b6edb8fecbc33546fd8d5aa6504 | |
parent | 9336fb5fde9ef9ec8ccde6d3e0ae2670e80af3ab (diff) | |
download | todo-cbd0080c1f77fd24dd9328402c98f6ad726cc19d.tar.xz |
todo: Move file parsing to top of parse_args
-rwxr-xr-x | todo | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -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): |