bin/onering in onering-client-0.0.30 vs bin/onering in onering-client-0.0.32
- old
+ new
@@ -140,18 +140,19 @@
end
end
# SAVE
devices.subcommand :save, "Creates or updates a new device in Onering, reading a JSON document from standard input" do |sc|
- sc.usage = "cat device.json | onering devices save [ID]"
+ sc.usage = "onering report | onering devices save [ID]"
sc.exec do
unless STDIN.tty?
begin
json = ::JSON.load(STDIN.read)
raise "Input document must specify an ID" if sc[:args].empty? and not json['id']
- print_format(api.save((sc[:args].first || json['id']), json), :json)
+ rv = api.save((sc[:args].first || json['id']), json)
+ print_format(rv, :json) if rv
rescue Exception => e
STDERR.puts "#{e.class.name}: #{e.message}"
exit 1
end
end
\ No newline at end of file