mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-03 19:40:15 +01:00
added verbose option
This commit is contained in:
parent
353c1b3dd1
commit
e0f7eec171
1 changed files with 7 additions and 3 deletions
|
|
@ -145,12 +145,12 @@ module Gtd
|
||||||
req.basic_auth ENV['GTD_LOGIN'], ENV['GTD_PASSWORD']
|
req.basic_auth ENV['GTD_LOGIN'], ENV['GTD_PASSWORD']
|
||||||
req.body = "<todo>#{props}</todo>"
|
req.body = "<todo>#{props}</todo>"
|
||||||
|
|
||||||
puts req.body
|
puts req.body if options[:verbose]
|
||||||
|
|
||||||
resp = http.request(req)
|
resp = http.request(req)
|
||||||
|
|
||||||
if resp.code == '302' || resp.code == '201'
|
if resp.code == '302' || resp.code == '201'
|
||||||
puts resp['location']
|
puts resp['location'] if options[:verbose]
|
||||||
|
|
||||||
# return the todo id
|
# return the todo id
|
||||||
return resp['location'].split("/").last
|
return resp['location'].split("/").last
|
||||||
|
|
@ -183,7 +183,7 @@ module Gtd
|
||||||
resp = http.request(req)
|
resp = http.request(req)
|
||||||
|
|
||||||
if resp.code == '302' || resp.code == '201'
|
if resp.code == '302' || resp.code == '201'
|
||||||
puts resp['location']
|
puts resp['location'] if options[:verbose]
|
||||||
|
|
||||||
# return the project id
|
# return the project id
|
||||||
return resp['location'].split("/").last
|
return resp['location'].split("/").last
|
||||||
|
|
@ -249,6 +249,10 @@ module Gtd
|
||||||
@keywords[v.split("=")[0]] = v.split("=")[1]
|
@keywords[v.split("=")[0]] = v.split("=")[1]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
cmd.on('-v', "verbose on") do |v|
|
||||||
|
@options[:verbose] = true
|
||||||
|
end
|
||||||
|
|
||||||
cmd.on('-f [S]', "filename of the template") do |v|
|
cmd.on('-f [S]', "filename of the template") do |v|
|
||||||
@filename = v
|
@filename = v
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue