36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
# File 'bin/i2cssh', line 36
def set_options(config_hash, login_override=nil)
if config_hash["columns"] and config_hash["rows"]
puts "CONFIG ERROR: rows and columns can't be used at the same time"
exit 1
end
if @i2_options.size == 0
@i2_options << {}
else
@i2_options << @i2_options.first.clone
end
[:broadcast, :profile, :rank, :iterm2, :login, :columns, :rows, :sleep, :direction, :itermname].each do |p|
@i2_options.last[p] = config_hash[p.to_s].nil? ? @i2_options.last[p] : config_hash[p.to_s]
end
@i2_options.last[:login] = login_override if login_override
@i2_options.last[:direction] ||= :column
@i2_options.last[:direction] = @i2_options.last[:direction].to_sym
if config_hash["environment"]
if @ssh_environment.empty?
@ssh_environment << {}
else
@ssh_environment << @ssh_environment.first.clone
end
@ssh_environment.last.merge!(config_hash["environment"].inject({}){|m, v| m.merge(v)})
else
@ssh_environment << {}
end
end
|