From 24911dea0afe29ddad3e8e295eb552a179f67db7 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Thu, 15 Aug 2019 18:13:20 +0200 Subject: add * for waiting-for tasks --- README.md | 1 + notagain | 2 +- notyet | 6 +++--- ny2html | 3 ++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 08697ee..56432cd 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ Tasks can have four different states, represented by the first non-whitespace character of the line: * Open tasks: `-` +* Started tasks (waiting for / assigned to other people): `*` * Maybe tasks: `?` * Finished tasks: `x` * WONTFIX tasks (tasks you decided not to do): `X` diff --git a/notagain b/notagain index 6c474c8..faa40b4 100755 --- a/notagain +++ b/notagain @@ -10,7 +10,7 @@ def parse(io, filename=nil) todos = [Entry.new(-1, "/", "", nil, [])] while line = io.gets - if line =~ /\A(?:\s*(?:#|\/\/)\s)?(\s*)([-xX?])\s+(.*)/ + if line =~ /\A(?:\s*(?:#|\/\/)\s)?(\s*)([-xX?*])\s+(.*)/ force = nil i, state, desc = $1.size, $2, $3 diff --git a/notyet b/notyet index 76d345f..5b8b894 100755 --- a/notyet +++ b/notyet @@ -82,7 +82,7 @@ class Entry < Struct.new(:depth, :state, :desc, :file, :line, :children) end def force(state) - self.state = state unless "xX?".index(self.state) + self.state = state unless "xX?*".index(self.state) children.each { |c| c.force(state) } end @@ -139,7 +139,7 @@ def parse(io, filename=nil) fname, lineno = filename, io.lineno end - if line =~ /\A(?:\s*(?:#|\/\/)\s)?(\s*)([-xX?])\s+(.*)/ + if line =~ /\A(?:\s*(?:#|\/\/)\s)?(\s*)([-xX?*])\s+(.*)/ i, state, desc = $1.size, $2, $3 while i <= todos.last.depth todos.pop @@ -235,7 +235,7 @@ t.stat t.filter(ARGV) if count_only - puts "#{t.count("xX")}/#{t.count("-xX")}" + puts "#{t.count("xX")}/#{t.count("-xX*")}" exit end diff --git a/ny2html b/ny2html index 8bf7279..e23a08f 100755 --- a/ny2html +++ b/ny2html @@ -10,7 +10,7 @@ def parse(io, filename=nil) todos = [Entry.new(-1, "/", "", [])] while line = io.gets - if line =~ /\A(?:\s*(?:#|\/\/)\s)?(\s*)([-xX?])\s+(.*)/ + if line =~ /\A(?:\s*(?:#|\/\/)\s)?(\s*)([-xX?*])\s+(.*)/ i, state, desc = $1.size, $2, $3 while i <= todos.last.depth todos.pop @@ -32,6 +32,7 @@ def render(e) when "x"; puts "☑" when "X"; puts "☒" when "?"; puts "?" # or 2370 + when "*"; puts "⊞" end puts e.desc.sub(/(^\s*)\(([A-Z])\)/) { $1 + "" + [$2.ord + 9333].pack("U") + "" }. gsub(/(?<=\s)@\w+/, '\&') -- cgit 1.4.1