switched to using Readline library instead of

STDIN for icmd command
This commit is contained in:
2009-12-10 19:26:48 +02:00
parent 21f1be78d6
commit e06b141725

View File

@@ -1,3 +1,5 @@
require 'readline'
def load_config def load_config
Skyline.load_config Skyline.load_config
end end
@@ -55,24 +57,17 @@ def icmd
puts "the \"use\" command to select one." puts "the \"use\" command to select one."
return nil return nil
end end
exit = false puts "Entering interactive remote-terminal mode."
started = false puts ""
while !exit puts "All entered commands are executed on all remote"
if !started puts "instances within selected auto-scaling group."
puts "Entering interactive remote-terminal mode." puts ""
puts "" puts "Type \"exit\" \"halt\" or press CTRL+D to exit."
puts "All entered commands are executed on all remote" puts ""
puts "instances within selected auto-scaling group." while input = Readline.readline("irt$ ", true)
puts ""
puts "Type \"exit\"\" or \"halt\"\" to exit IRT mode."
puts ""
started = true
end
print "irt$ "
input = STDIN.readline.strip
if !input.nil? && input != "" if !input.nil? && input != ""
if input =~ /^exit|halt$/ if input =~ /^exit|halt$/
exit = true break
else else
cmd(input) cmd(input)
end end