Module: Pylonite::CLI

Defined in:
lib/pylonite/cli.rb

Constant Summary collapse

BOARD_COLORS =
{
  "backlog" => "\e[37m",
  "todo" => "\e[33m",
  "in_progress" => "\e[36m",
  "done" => "\e[32m",
  "archived" => "\e[90m"
}.freeze
RESET =
"\e[0m"
BOLD =
"\e[1m"
DIM =
"\e[2m"

Class Method Summary collapse

Class Method Details

.run(args) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/pylonite/cli.rb', line 15

def self.run(args)
  command = args.shift
  case command
  when "add" then cmd_add(args)
  when "show" then cmd_show(args)
  when "list" then cmd_list(args)
  when "move" then cmd_move(args)
  when "comment" then cmd_comment(args)
  when "search" then cmd_search(args)
  when "archive" then cmd_archive(args)
  when "assign" then cmd_assign(args)
  when "block" then cmd_block(args)
  when "unblock" then cmd_unblock(args)
  when "subtask" then cmd_subtask(args)
  when "edit" then cmd_edit(args)
  when "log" then cmd_log(args)
  when "internal" then cmd_internal(args)
  when "tui" then Pylonite::TUI.run
  when "help", "--help", "-h", nil then Pylonite::Help.display
  else
    error("Unknown command: #{command}. Run 'pylonite help' for usage.")
  end
rescue => e
  error(e.message)
end