Land #10464, prompt to use plain module name
commit
101539a1bc
|
@ -503,6 +503,13 @@ protected
|
|||
print_error("Permission denied exec: #{line}")
|
||||
end
|
||||
self.busy = false
|
||||
return
|
||||
elsif framework.modules.create(method)
|
||||
super
|
||||
if prompt_yesno "This is a module we can load. Do you want to use #{method}?"
|
||||
run_single "use #{method}"
|
||||
end
|
||||
|
||||
return
|
||||
end
|
||||
end
|
||||
|
|
|
@ -429,6 +429,18 @@ protected
|
|||
rlog(buf, log_source) if (log_source)
|
||||
end
|
||||
|
||||
#
|
||||
# Prompt the user for input if possible. Special edition for use inside commands.
|
||||
#
|
||||
def prompt_yesno(query)
|
||||
p = "#{query} [y/N]"
|
||||
old_p = [self.prompt.sub(/#{self.prompt_char} $/, ''), self.prompt_char]
|
||||
update_prompt p, ' ', true
|
||||
/^y/ === get_input_line
|
||||
ensure
|
||||
update_prompt *old_p, true
|
||||
end
|
||||
|
||||
attr_writer :input, :output # :nodoc:
|
||||
attr_accessor :stop_flag, :init_prompt, :cont_prompt # :nodoc:
|
||||
attr_accessor :prompt # :nodoc:
|
||||
|
|
Loading…
Reference in New Issue