lib/koma/cli.rb in koma-0.8.0 vs lib/koma/cli.rb in koma-0.9.0
- old
+ new
@@ -33,10 +33,11 @@
if host.nil?
begin
stdin = timeout(5) do
$stdin.read
end
+
rescue Timeout::Error
STDERR.puts 'ERROR: "koma ssh" was called with no arguments'
STDERR.puts 'Usage: "koma ssh <host1,host2,..>"'
return
end
@@ -45,9 +46,10 @@
Regexp.last_match[1]
end
host = ret.join(',')
end
backend = Koma::Backend::Ssh.new(host, options)
+ backend.stdin = stdin if stdin
if options[:yaml]
puts YAML.dump(backend.gather)
else
puts JSON.pretty_generate(backend.gather)
end