mirror of
https://github.com/jimeh/skyline.git
synced 2026-02-19 11:06:39 +00:00
switched to using Readline library instead of
STDIN for icmd command
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user