class Byebug::QuitCommand

Implements byebug “quit” command

def description

def description
  %{
    q[uit][ !| unconditionally]\texit from byebug.
    exit[!]\talias to quit
    Normally we prompt before exiting. However if the parameter
    "unconditionally" is given or command is suffixed with !, we exit
    without asking further questions.
   }
end

def execute

def execute
  if @match[1] or confirm("Really quit? (y/n) ")
    @state.interface.finalize
    exit! # exit -> exit!: No graceful way to stop...
  end
end

def names

def names
  %w(quit exit)
end

def regexp

def regexp
  / ^\s*
     (?:q(?:uit)?|exit) \s*
     (!|\s+unconditionally)? \s*
     $
  /ix
end