Skip to content

Commit 4f3ee6d

Browse files
committed
Address PR comments regarding command options
1 parent b8296a8 commit 4f3ee6d

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,19 @@ def cmd_list_data_services()
100100

101101
def cmd_add_data_service(*args)
102102
protocol = "http"
103+
port = 80
103104
while (arg = args.shift)
104105
case arg
105-
when '--help'
106+
when '-h', '--help'
106107
cmd_add_data_service_help
107108
return
108-
when '-h'
109-
host = args.shift
110109
when '-p'
111110
port = args.shift
112-
when '-s'
111+
when '-s', '--ssl'
113112
protocol = "https"
114113
args.shift
114+
else
115+
host = arg
115116
end
116117
end
117118

@@ -127,12 +128,12 @@ def cmd_add_data_service(*args)
127128
end
128129

129130
def cmd_add_data_service_help
130-
print_line "Usage: add_data_service [ options ] -h <host IP or FQDN> -p <host port>"
131+
print_line "Usage: add_data_service [ options ] [ Remote Address]"
131132
print_line
132133
print_line "OPTIONS:"
133-
print_line " -h <IP/FQDN> The IP address or FQDN of the data service server."
134-
print_line " -p <port> The port the data service is listening on."
135-
print_line " -s Enable SSL. Required for HTTPS data services."
134+
print_line " -h, --help Show this help information."
135+
print_line " -p <port> The port the data service is listening on. Default is 80"
136+
print_line " -s, --ssl Enable SSL. Required for HTTPS data services."
136137
print_line
137138
end
138139

msfdb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ def parse_args(args)
4545
opts[:ssl] = true
4646
end
4747

48-
opt.on('-c', '--cert <path/to/cert.pem>', String, 'Path to your SSL Certificate file') do |p|
48+
opt.on('-c', '--cert <path/to/cert.pem>', String, 'Path to SSL Certificate file') do |p|
4949
opts[:ssl_cert] = p
5050
end
5151

52-
opt.on('-k', '--key <path/to/key.pem>', String, 'Path to your SSL Key file') do |p|
52+
opt.on('-k', '--key <path/to/key.pem>', String, 'Path to SSL Key file') do |p|
5353
opts[:ssl_key] = p
5454
end
5555

0 commit comments

Comments
 (0)