Skip to content

Commit e729254

Browse files
authored
minor tweaks
added dots to the end of lines, checked val for nil before runing match
1 parent f073e78 commit e729254

File tree

1 file changed

+4
-4
lines changed
  • lib/msf/ui/console/command_dispatcher

1 file changed

+4
-4
lines changed

lib/msf/ui/console/command_dispatcher/core.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ class Core
8787

8888
@@history_opts = Rex::Parser::Arguments.new(
8989
"-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." ])
9292

9393
@@irb_opts = Rex::Parser::Arguments.new(
9494
"-h" => [ false, "Help banner." ],
@@ -489,7 +489,7 @@ def cmd_history(*args)
489489
when "-a"
490490
limit = length
491491
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/)
493493
limit = val.to_i
494494
limit = length if limit >= length
495495
when "-h"
@@ -508,7 +508,7 @@ def cmd_history_help
508508
print_line "Usage: history [options]"
509509
print_line
510510
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."
512512
print_line
513513
print @@history_opts.usage
514514
end

0 commit comments

Comments
 (0)