Permalink
Browse files

Add duplicate command, allows duplication of a task

  • Loading branch information...
1 parent a1c2344 commit cb57e247a1897f2b0d2642224dd9ba5746178b14 @langhorst committed May 5, 2011
Showing with 15 additions and 0 deletions.
  1. +15 −0 bin/pomo
View
@@ -251,3 +251,18 @@ command :move do |c|
end
end
+command :duplicate do |c|
+ c.syntax = 'pomo duplicate [task]'
+ c.summary = 'Duplicate a task'
+ c.description = 'Duplicate a task, adding the duplicated task to the end of the list'
+ c.example 'Duplicate the first task', 'pomo duplicate first'
+ c.example 'Duplicate task 4', 'pomo duplicate 4'
+ c.action do |args|
+ list.find(args[0]) do |task, i|
+ list.add(task)
+ say " - duplicated #{task}"
+ end
+ list.save
+ end
+end
+

0 comments on commit cb57e24

Please sign in to comment.