]> git.cworth.org Git - sup/blobdiff - lib/sup/tagger.rb
Merge branch 'master' into next
[sup] / lib / sup / tagger.rb
index 3e72463fc0e90128c5dd39e4c3f3535d9bc2cd7f..d62f3404557d637af7c70631e780ad0c63b1df02 100644 (file)
@@ -1,9 +1,11 @@
 module Redwood
 
 class Tagger
-  def initialize mode
+  def initialize mode, noun="thread", plural_noun=nil
     @mode = mode
     @tagged = {}
+    @noun = noun
+    @plural_noun = plural_noun || (@noun + "s")
   end
 
   def tagged? o; @tagged[o]; end
@@ -21,7 +23,7 @@ class Tagger
       return
     end
 
-    noun = num_tagged == 1 ? "thread" : "threads"
+    noun = num_tagged == 1 ? @noun : @plural_noun
 
     unless action
       c = BufferManager.ask_getch "apply to #{num_tagged} tagged #{noun}:"