add help command

This commit is contained in:
kaitoozawa
2025-12-19 16:47:19 +10:00
parent dca4415fb8
commit 85d8d78112
2 changed files with 17 additions and 3 deletions

4
beef
View File

@@ -39,6 +39,10 @@ $root_dir = File.join(File.expand_path(File.dirname(File.realpath(__FILE__))), '
$:.unshift($root_dir)
$home_dir = File.expand_path("#{Dir.home}/.beef/", __FILE__).freeze
# @note Parse BeEF CLI options early (prevents Rack help from taking over)
require 'core/main/console/commandline'
BeEF::Core::Console::CommandLine.parse
#
# @note Require core loader
#

View File

@@ -3,6 +3,8 @@
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
require 'optparse'
module BeEF
module Core
module Console
@@ -38,7 +40,7 @@ module BeEF
@options[:verbose] = true
end
opts.on('-a', '--ascii_art', 'Prints BeEF ascii art') do
opts.on('-a', '--ascii-art', 'Prints BeEF ascii art') do
@options[:ascii_art] = true
end
@@ -54,14 +56,22 @@ module BeEF
@options[:ws_port] = ws_port
end
opts.on('-ud', '--update_disabled', 'Skips update') do
opts.on('-d', '--update-disabled', 'Skips update') do
@options[:update_disabled] = true
end
opts.on('-ua', '--update_auto', 'Automatic update with no prompt') do
opts.on('-u', '--update-auto', 'Automatic update with no prompt') do
@options[:update_auto] = true
end
opts.on('-h', '--help', 'Show this help') do
puts opts
exit 0
end
# opts.on('-i', '--interactive', 'Starts with the Console Shell activated') do
# @options[:interactive] = true
# end
end
optparse.parse!