1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
module TicGitNG
module Command
module Tag
def parser(opts)
opts.banner = "Usage: ti tag [tic_id] [options] [tag_name] "
opts.on_head(
"-d", "--delete",
"Remove this tag from the ticket"){|v| options.remove = v }
end
def execute
if args.size > 1 # `ti tag 1234abc tagname1`
tic.ticket_tag(args[1], args[0].chomp, options)
elsif args.size == 1 # `ti tag tagname1`
tic.ticket_tag(args[0], nil, options)
else
puts 'You need to at least specify one tag to add'
puts
puts usage
end
end
end
end
end
|