Skip to content

Commit 39b7fa0

Browse files
committed
add help command
1 parent b7ebc29 commit 39b7fa0

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

beef

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ $root_dir = File.join(File.expand_path(File.dirname(File.realpath(__FILE__))), '
3939
$:.unshift($root_dir)
4040
$home_dir = File.expand_path("#{Dir.home}/.beef/", __FILE__).freeze
4141

42+
# @note Parse BeEF CLI options early (prevents Rack help from taking over)
43+
require 'core/main/console/commandline'
44+
BeEF::Core::Console::CommandLine.parse
45+
4246
#
4347
# @note Require core loader
4448
#

core/main/console/commandline.rb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# Browser Exploitation Framework (BeEF) - https://beefproject.com
44
# See the file 'doc/COPYING' for copying permission
55
#
6+
require 'optparse'
7+
68
module BeEF
79
module Core
810
module Console
@@ -39,7 +41,7 @@ def self.parse
3941
@options[:verbose] = true
4042
end
4143

42-
opts.on('-a', '--ascii_art', 'Prints BeEF ascii art') do
44+
opts.on('-a', '--ascii-art', 'Prints BeEF ascii art') do
4345
@options[:ascii_art] = true
4446
end
4547

@@ -55,14 +57,19 @@ def self.parse
5557
@options[:ws_port] = ws_port
5658
end
5759

58-
opts.on('-ud', '--update_disabled', 'Skips update') do
60+
opts.on('-d', '--update-disabled', 'Skips update') do
5961
@options[:update_disabled] = true
6062
end
6163

62-
opts.on('-ua', '--update_auto', 'Automatic update with no prompt') do
64+
opts.on('-u', '--update-auto', 'Automatic update with no prompt') do
6365
@options[:update_auto] = true
6466
end
6567

68+
opts.on('-h', '--help', 'Show this help') do
69+
puts opts
70+
exit 0
71+
end
72+
6673
# opts.on('-i', '--interactive', 'Starts with the Console Shell activated') do
6774
# @options[:interactive] = true
6875
# end

0 commit comments

Comments
 (0)