@@ -87,8 +87,8 @@ class Core
87
87
88
88
@@history_opts = Rex ::Parser ::Arguments . new (
89
89
"-h" => [ false , "Help banner." ] ,
90
- "-a" => [ false , "Show all commands in history" ] ,
91
- "-n" => [ true , "Show the last n commands" ] )
90
+ "-a" => [ false , "Show all commands in history." ] ,
91
+ "-n" => [ true , "Show the last n commands. " ] )
92
92
93
93
@@irb_opts = Rex ::Parser ::Arguments . new (
94
94
"-h" => [ false , "Help banner." ] ,
@@ -489,7 +489,7 @@ def cmd_history(*args)
489
489
when "-a"
490
490
limit = length
491
491
when "-n"
492
- return cmd_history_help unless val . match /\A [-+]?\d +\z /
492
+ return cmd_history_help unless ! val . nil? && val . match ( /\A [-+]?\d +\z / )
493
493
limit = val . to_i
494
494
limit = length if limit >= length
495
495
when "-h"
@@ -508,7 +508,7 @@ def cmd_history_help
508
508
print_line "Usage: history [options]"
509
509
print_line
510
510
print_line "Shows the command history."
511
- print_line "If -n is not set, it will only be shown the last #{ @history_limit } commands"
511
+ print_line "If -n is not set, it will only be shown the last #{ @history_limit } commands. "
512
512
print_line
513
513
print @@history_opts . usage
514
514
end
0 commit comments