diff options
author | elijah <elijah@riseup.net> | 2016-09-06 12:35:09 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2016-09-06 12:35:24 -0700 |
commit | d6c2d90d6efa692e338529e49b0a0bc84bf971f5 (patch) | |
tree | 54fef759f459ae0487ff54067c89e17134c6db86 /lib | |
parent | 26afb64224872777dd8739bf98ae04bad9a0e405 (diff) |
leap run: stream results by default if there is only one node
Diffstat (limited to 'lib')
-rw-r--r-- | lib/leap_cli/commands/run.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/leap_cli/commands/run.rb b/lib/leap_cli/commands/run.rb index a12af60e..cad9b7a0 100644 --- a/lib/leap_cli/commands/run.rb +++ b/lib/leap_cli/commands/run.rb @@ -5,7 +5,7 @@ module LeapCli; module Commands "For example, `leap run 'uname -a' webapp`" arg_name 'COMMAND FILTER' command :run do |c| - c.switch 'stream', :default => false, :desc => 'If set, stream the output as it arrives. (default: --no-stream)' + c.switch 'stream', :default => false, :desc => 'If set, stream the output as it arrives. (default: --stream for a single node, --no-stream for multiple nodes)' c.flag 'port', :arg_name => 'SSH_PORT', :desc => 'Override default SSH port used when trying to connect to the server.' c.action do |global, options, args| run_shell_command(global, options, args) @@ -20,7 +20,7 @@ module LeapCli; module Commands filter = args[1..-1] cmd = global[:force] ? cmd : LeapCli::SSH::Options.sanitize_command(cmd) nodes = manager.filter!(filter) - if options[:stream] + if nodes.size == 1 || options[:stream] stream_command(nodes, cmd, options) else capture_command(nodes, cmd, options) |