public
Rubygem
Description: Git based distributed ticketing system, including a command line client and web viewer
Clone URL: git://github.com/schacon/ticgit.git
Search Repo:
- added a -f/--file option to ti comment so a comment can be provided via 
a file
yob (author)
Mon May 12 07:27:25 -0700 2008
schacon (committer)
Mon May 12 17:13:12 -0700 2008
commit  a4a1aff40ba4604682cfd62e5239bd120b82b851
tree    6e5853faf2823f116c1be29e9ccbf411f1a62188
parent  6e453f523fa1da50ecb04431101112b3611c6a4d
...
116
117
118
 
 
 
 
 
 
119
120
121
...
127
128
129
 
 
130
131
132
...
116
117
118
119
120
121
122
123
124
125
126
127
...
133
134
135
136
137
138
139
140
0
@@ -116,6 +116,12 @@
0
         opts.on("-m MESSAGE", "--message MESSAGE", "Message you would like to add as a comment") do |v|
0
           @options[:message] = v
0
         end
0
+ opts.on("-f FILE", "--file FILE", "A file that contains the comment you would like to add") do |v|
0
+ raise ArgumentError, "Only 1 of -f/--file and -m/--message can be specified" if @options[:message]
0
+ raise ArgumentError, "File #{v} doesn't exist" unless File.file?(v)
0
+ raise ArgumentError, "File #{v} must be <= 2048 bytes" unless File.size(v) <= 2048
0
+ @options[:file] = v
0
+ end
0
       end.parse!
0
     end
0
 
0
@@ -127,6 +133,8 @@
0
       
0
       if(m = options[:message])
0
         tic.ticket_comment(m, tid)
0
+ elsif(f = options[:file])
0
+ tic.ticket_comment(File.read(options[:file]), tid)
0
       else
0
         if message = get_editor_message
0
           tic.ticket_comment(message.join(''), tid)

Comments

    No one has commented yet.