diff --git a/README.md b/README.md index 006d804..d582ec4 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Commands: * start mark task as started * done mark task as completed * block mark task as blocked +* reset reset task to new state * prio toggle high priority flag * due set due date diff --git a/bin/todo.rb b/bin/todo.rb index 9116880..51f493f 100644 --- a/bin/todo.rb +++ b/bin/todo.rb @@ -93,6 +93,7 @@ def usage * start mark task as started * done mark task as completed * block mark task as blocked + * reset reset task to new state * prio toggle high priority flag * due set due date @@ -213,7 +214,7 @@ def list(tasks = nil, patterns = nil) items[num] = task if match end items = items.sort_by do |num, task| - [task[:priority] ? 0 : 1, ORDER[task[:state] || 'default'], task[:due] || 'n/a', num] + [task[:priority] && task[:state] != 'done' ? 0 : 1, ORDER[task[:state] || 'default'], task[:due] || 'n/a', num] end items.each do |num, task| state = task[:state] || 'default' @@ -293,6 +294,8 @@ def read(arguments) args.length == 1 ? change_state(args.first.to_i, 'done') : list(nil, [':done']) when 'block' args.length == 1 ? change_state(args.first.to_i, 'blocked') : list(nil, [':blocked']) + when 'reset' + args.length == 1 ? change_state(args.first.to_i, 'new') : list(nil, [':new']) when 'prio' set_priority(args.first.to_i) if args.length == 1 when 'due' diff --git a/todo.gemspec b/todo.gemspec index 1d9937f..77b089a 100644 --- a/todo.gemspec +++ b/todo.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.name = 'todo-jsonl' - s.version = '0.1.5' - s.date = '2020-10-02' + s.version = '0.1.6' + s.date = '2020-10-04' s.summary = 'todo list manager inspired by todo.txt using the jsonl format' s.authors = ['Gabor Bata'] s.homepage = 'https://github.com/gaborbata/todo'