lib/cli.rb in trollolo-0.0.8 vs lib/cli.rb in trollolo-0.0.9
- old
+ new
@@ -204,19 +204,19 @@
b = Backup.new @@settings
b.backup(options["board-id"])
end
- desc "list_backups", "List all backups"
+ desc "list-backups", "List all backups"
def list_backups
b = Backup.new @@settings
b.list.each do |backup|
puts backup
end
end
- desc "show_backup", "Show backup of board"
+ desc "show-backup", "Show backup of board"
option "board-id", :desc => "Id of Trello board", :required => true
option "show-descriptions", :desc => "Show descriptions of cards", :required => false, :type => :boolean
def show_backup
b = Backup.new @@settings
b.show(options["board-id"], options)
@@ -255,11 +255,11 @@
trello = TrelloWrapper.new(@@settings)
trello.set_description(options["card-id"], STDIN.read)
end
- desc "organization_members", "Show organization members"
+ desc "organization-members", "Show organization members"
option "org-name", :desc => "Name of organization", :required => true
def organization_members
process_global_options options
require_trello_credentials
@@ -289,9 +289,53 @@
process_global_options(options)
require_trello_credentials
trello = TrelloWrapper.new(@@settings)
trello.make_cover(options["card-id"], filename)
+ end
+
+ desc "set-priorities", "Set priority text into card titles"
+ long_desc <<EOT
+ Add 'P<n>: ' to the beginning of every cards title, replace where
+ already present. n is the current position of the list on the card.
+EOT
+ option "board-id", :desc => "Id of the board", :required => true
+ option "list-name", :desc => "Name of the list", :required => true
+ def set_priorities
+ process_global_options options
+ require_trello_credentials
+
+ p = Prioritizer.new(@@settings)
+ p.prioritize(options["board-id"], options["list-name"])
+ end
+
+ desc "list-member-boards", "List name and id of all boards"
+ option "member-id", :desc => "Id of the member", :required => true
+ def list_member_boards
+ process_global_options options
+ require_trello_credentials
+
+ trello = TrelloWrapper.new(@@settings)
+ trello.get_member_boards(options["member-id"]).sort_by { |board|
+ board["name"]
+ }.each { |board|
+ puts "#{board["name"]} - #{board["id"]}"
+ }
+ end
+
+ desc "sprint-cleanup", "Move remaining cards to backlog"
+ long_desc <<EOT
+ After the sprint, move remaining cards from 'Sprint Backlog' and 'Doing'
+ back to the planning board into the 'Ready' list.
+EOT
+ option "board-id", :desc => "Id of the board", :required => true
+ option "target-board-id", :desc => "Id of the target board", :required => true
+ def sprint_cleanup
+ process_global_options options
+ require_trello_credentials
+
+ s = SprintCleanup.new(@@settings)
+ s.cleanup(options["board-id"], options["target-board-id"])
end
private
def process_global_options options