bin/onering in onering-client-0.0.22 vs bin/onering in onering-client-0.0.23
- old
+ new
@@ -210,16 +210,16 @@
:pemfile => ENV['ONERING_PEM']
})
call.usage = "onering call path/to/endpoint"
call.opt :as_txt, '-t', '--as-text', "Return the results as text"
- call.opt :method, '-m', '--method', "The HTTP method to use for the call (default: GET)"
+ call.opt :method, '-m', '--method VERB', "The HTTP method to use for the call (default: GET)"
call.opt :opts, '-o', '--option KEY:VALUE', Array, "A comma-separated list of key:value querystrings to pass with the request"
call.exec do
rv = api.request(call[:args].first.to_sym, {
:method => (call[:method] || :get),
- :data => (STDIN.tty? ? nil : ::JSON.load(STDIN.read)),
+ :data => (STDIN.tty? ? {} : ::JSON.load(STDIN.read)),
:fields => (Hash[call[:opts].collect{|i| i.split(':',2) }] rescue {})
})
print_format(rv, (call[:as_txt] ? :text : nil)) unless rv.nil? or rv.to_s.strip.chomp.empty?
end
\ No newline at end of file