mssh 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/bin/mssh +12 -1
  2. metadata +4 -4
data/bin/mssh CHANGED
@@ -39,11 +39,22 @@ optparse = OptionParser.new do |opts|
39
39
  opts.on('-d', '--debug', "Debug output") do |arg|
40
40
  options[:debug] = arg
41
41
  end
42
+ opts.on('--sshopt OPT', "ssh options, default [-2, -oBatchMode=yes, -A]. Can be used multiple times.") do |arg|
43
+ options[:sshopt] ||= []
44
+ options[:sshopt] << arg
45
+ end
46
+ opts.on('--sshcmd BINARY', "Path to the ssh binary") do |arg|
47
+ options[:sshcmd] = arg
48
+ end
42
49
  # option to merge stdin/stdout into one buf?
43
50
  # option to ignore as-we-go yield output
44
51
  end
45
52
  optparse.parse!
46
53
 
54
+ # default options
55
+ options[:sshopt] ||= ["-2", "-oBatchMode=yes", "-A"]
56
+ options[:sshcmd] = "/usr/bin/ssh"
57
+
47
58
  targets = []
48
59
  if (options[:range].nil? and options[:file].nil? and options[:hostlist].nil?)
49
60
  raise "Error, need -r or -f or --hostlist option"
@@ -69,7 +80,7 @@ raise "too many arguments" if ARGV.size != 1
69
80
 
70
81
 
71
82
  m = MultipleCmd.new
72
- m.commands = targets.map { |t| ["/usr/bin/ssh","-2", "-oBatchMode=yes", "-A", t].push ARGV.first }
83
+ m.commands = targets.map { |t| [options[:sshcmd], *options[:sshopt] ].push t, ARGV.first }
73
84
  command_to_target = Hash.new
74
85
  targets.size.times do |i|
75
86
  command_to_target[m.commands[i].object_id] = targets[i]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mssh
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 7
10
- version: 0.0.7
9
+ - 9
10
+ version: 0.0.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Evan Miller
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-02-14 00:00:00 Z
18
+ date: 2013-04-11 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: json