lib/hammer_cli/shell.rb in hammer_cli-0.1.1 vs lib/hammer_cli/shell.rb in hammer_cli-0.1.2

- old
+ new

@@ -26,11 +26,11 @@ end end def self.load_commands(main_cls) cmds = main_cls.recognised_subcommands.select do |sub_cmd| - !(sub_cmd.subcommand_class <= HammerCLI::ShellCommand) + !sub_cmd.is_called?("shell") end self.recognised_subcommands.push(*cmds) end autoload_subcommands @@ -101,14 +101,14 @@ history.push(line) line = HammerCLI::CompleterLine.new(line) ShellMainCommand.run('', line, context) unless line.empty? end - rescue Interrupt => e - puts - system('stty', stty_save) # Restore - exit - end + rescue Interrupt; end + + puts + system('stty', stty_save) # Restore + HammerCLI::EX_OK end private def prompt