1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
Subject: Support “ti tag -d $TAG” to remove tags
From: Michael Schutte <michi@debian.org>
The “tag” command gets confused by the extra “-d” argument and therefore
fails to actually delete tags. The problem is caused by using the
original list of command line arguments before parsing (ARGV) instead of
the processed one (args).
Index: devel/lib/ticgit-ng/command/tag.rb
===================================================================
--- devel.orig/lib/ticgit-ng/command/tag.rb 2013-06-27 17:59:16.000000000 +0200
+++ devel/lib/ticgit-ng/command/tag.rb 2013-06-27 21:10:31.000000000 +0200
@@ -9,14 +9,10 @@
end
def execute
- if options.remove
- puts 'remove'
- end
-
- if ARGV.size > 2 # `ti tag 1234abc tagname1`
- tic.ticket_tag(ARGV[2], ARGV[1].chomp, options)
- elsif ARGV.size == 2 # `ti tag tagname1`
- tic.ticket_tag(ARGV[1], nil, options)
+ 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
|