Compare commits
1 commit
27d11e266e
...
9dfa380e2f
Author | SHA1 | Date | |
---|---|---|---|
9dfa380e2f |
3 changed files with 40 additions and 70 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,2 +0,0 @@
|
||||||
|
|
||||||
bin
|
|
|
@ -16,15 +16,50 @@ module AutoBoard
|
||||||
parser = OptionParser.new do |opts|
|
parser = OptionParser.new do |opts|
|
||||||
opts.banner = "Usage: autoboard [options]"
|
opts.banner = "Usage: autoboard [options]"
|
||||||
|
|
||||||
opts.on("board", "Manage boards", &board_parser(opts))
|
opts.on("-t", "--template TEMPLATE_NAME", "Create or manage templates") do |template_name|
|
||||||
opts.on("host", "Manage hosts", &host_parser(opts))
|
@options[:template] = template_name
|
||||||
opts.on("template", "Manage templates", &template_parser(opts))
|
end
|
||||||
opts.on("workspace", "Manage workspaces", &workspace_parser(opts))
|
|
||||||
|
opts.on("-b", "--board BOARD_ID", "Create or manage boards") do |board_id|
|
||||||
|
@options[:board] = board_id
|
||||||
|
end
|
||||||
|
|
||||||
opts.on("-p", "--project PROJECT_ID", "Choose a project for the board") do |project_id|
|
opts.on("-p", "--project PROJECT_ID", "Choose a project for the board") do |project_id|
|
||||||
@options[:project] = project_id
|
@options[:project] = project_id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
opts.on("-n", "--name LIST_NAME", "Name of the list") do |list_name|
|
||||||
|
@options[:list_name] = list_name
|
||||||
|
end
|
||||||
|
|
||||||
|
opts.on("-l", "--label LABEL_NAME", "Name of the label") do |label_name|
|
||||||
|
@options[:label_name] = label_name
|
||||||
|
end
|
||||||
|
|
||||||
|
opts.on("-c", "--create", "Create a new template or board") do
|
||||||
|
@options[:create] = true
|
||||||
|
end
|
||||||
|
|
||||||
|
opts.on("-a", "--addlist", "Add a new list to the template") do
|
||||||
|
@options[:addlist] = true
|
||||||
|
end
|
||||||
|
|
||||||
|
opts.on("-r", "--rmlist", "Remove a list from the template") do
|
||||||
|
@options[:rmlist] = true
|
||||||
|
end
|
||||||
|
|
||||||
|
opts.on("-d", "--destroy", "Destroy a template or board") do
|
||||||
|
@options[:destroy] = true
|
||||||
|
end
|
||||||
|
|
||||||
|
opts.on("-i", "--inspect", "Inspect a template or board") do
|
||||||
|
@options[:inspect] = true
|
||||||
|
end
|
||||||
|
|
||||||
|
opts.on("-l", "--ls", "List templates or boards") do
|
||||||
|
@options[:ls] = true
|
||||||
|
end
|
||||||
|
|
||||||
opts.on("-h", "--help", "Show this help") do
|
opts.on("-h", "--help", "Show this help") do
|
||||||
puts opts
|
puts opts
|
||||||
exit
|
exit
|
||||||
|
@ -33,70 +68,7 @@ module AutoBoard
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def workspace_parser(opts : OptionParser)
|
def template_parser
|
||||||
->(value : String) do
|
|
||||||
opts.banner = "Usage: autoboard workspace [options]"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def host_parser(opts : OptionParser)
|
|
||||||
->(value : String) do
|
|
||||||
opts.banner = "Usage: autoboard host [options]"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def board_parser(opts : OptionParser)
|
|
||||||
->(value : String) do
|
|
||||||
opts.banner = "Usage: autoboard board [options]"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def template_column_parser(opts : OptionParser)
|
|
||||||
->(value : String) do
|
|
||||||
opts.on("create", "Add a new list to the template") do
|
|
||||||
opts.on("--label LABEL_ID", "Assign label LABEL_ID to the list") do |label_name|
|
|
||||||
@options[:label_name] = label_name
|
|
||||||
end
|
|
||||||
|
|
||||||
opts.on("--open", "Assign open tasks to the list") do |label_name|
|
|
||||||
end
|
|
||||||
|
|
||||||
opts.on("--closed", "Assign closed tasks to the list") do |label_name|
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
opts.on("destroy", "Remove a list from the template") do
|
|
||||||
end
|
|
||||||
|
|
||||||
opts.on("-c", "--column LIST_ID", "ID of the column") do |column_id|
|
|
||||||
@options[:column_id] = column_id
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def template_parser(opts : OptionParser)
|
|
||||||
->(value : String) do
|
|
||||||
opts.banner = "Usage: autoboard template [options]"
|
|
||||||
|
|
||||||
opts.on("create", "Create a new template") do
|
|
||||||
end
|
|
||||||
|
|
||||||
opts.on("column", "Manage templates columns", &template_column_parser(opts))
|
|
||||||
|
|
||||||
opts.on("list", "List templates") do
|
|
||||||
end
|
|
||||||
|
|
||||||
opts.on("inspect", "Inspect a template") do
|
|
||||||
end
|
|
||||||
|
|
||||||
opts.on("destroy", "Destroy a new template") do
|
|
||||||
end
|
|
||||||
|
|
||||||
opts.on("-t", "--template TEMPLATE_ID", "ID of the template") do |template_id|
|
|
||||||
@options[:template_id] = template_id
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue