@@ -5,6 +5,7 @@ use std::sync::Arc;
5
5
use std:: path:: Path ;
6
6
use std:: fs;
7
7
8
+ use clap:: builder:: PossibleValue ;
8
9
use clap:: { Arg , ArgMatches , Command , ArgAction } ;
9
10
use ipnetwork:: IpNetwork ;
10
11
use pnet_datalink:: MacAddr ;
@@ -52,17 +53,23 @@ pub fn build_args() -> Command {
52
53
. arg (
53
54
Arg :: new ( "profile" ) . short ( 'p' ) . long ( "profile" )
54
55
. value_name ( "PROFILE_NAME" )
55
- . help ( "Scan profile" )
56
+ . value_parser ( [
57
+ PossibleValue :: new ( "default" ) . help ( "Default scan profile" ) ,
58
+ PossibleValue :: new ( "fast" ) . help ( "Fast ARP scans (less accurate)" ) ,
59
+ PossibleValue :: new ( "stealth" ) . help ( "Slower scans (minimize impact)" ) ,
60
+ PossibleValue :: new ( "chaos" ) . help ( "Randomly-selected values" )
61
+ ] )
62
+ . help ( "Scan profile - a preset of ARP scan options" )
56
63
)
57
64
. arg (
58
65
Arg :: new ( "interface" ) . short ( 'i' ) . long ( "interface" )
59
66
. value_name ( "INTERFACE_NAME" )
60
- . help ( "Network interface" )
67
+ . help ( "Network interface (defaults to first 'up' interface with IPv4) " )
61
68
)
62
69
. arg (
63
70
Arg :: new ( "network" ) . short ( 'n' ) . long ( "network" )
64
71
. value_name ( "NETWORK_RANGE" )
65
- . help ( "Network range to scan" )
72
+ . help ( "Network range to scan (defaults to first IPv4 network on the interface) " )
66
73
)
67
74
. arg (
68
75
Arg :: new ( "file" ) . short ( 'f' ) . long ( "file" )
@@ -73,12 +80,12 @@ pub fn build_args() -> Command {
73
80
. arg (
74
81
Arg :: new ( "timeout" ) . short ( 't' ) . long ( "timeout" )
75
82
. value_name ( "TIMEOUT_DURATION" )
76
- . help ( "ARP response timeout" )
83
+ . help ( "ARP response timeout (2000ms) " )
77
84
)
78
85
. arg (
79
86
Arg :: new ( "source_ip" ) . short ( 'S' ) . long ( "source-ip" )
80
87
. value_name ( "SOURCE_IPV4" )
81
- . help ( "Source IPv4 address for requests " )
88
+ . help ( "Source IPv4 address (defaults to IPv4 address on the interface) " )
82
89
)
83
90
. arg (
84
91
Arg :: new ( "destination_mac" ) . short ( 'M' ) . long ( "dest-mac" )
@@ -88,7 +95,7 @@ pub fn build_args() -> Command {
88
95
. arg (
89
96
Arg :: new ( "source_mac" ) . long ( "source-mac" )
90
97
. value_name ( "SOURCE_MAC" )
91
- . help ( "Source MAC address for requests" )
98
+ . help ( "Source MAC address for requests (default to 00:00:00:00:00:00) " )
92
99
)
93
100
. arg (
94
101
Arg :: new ( "numeric" ) . long ( "numeric" )
@@ -103,7 +110,7 @@ pub fn build_args() -> Command {
103
110
. arg (
104
111
Arg :: new ( "retry_count" ) . short ( 'r' ) . long ( "retry" )
105
112
. value_name ( "RETRY_COUNT" )
106
- . help ( "Host retry attempt count" )
113
+ . help ( "Host retry attempt count (default to 1) " )
107
114
)
108
115
. arg (
109
116
Arg :: new ( "random" ) . short ( 'R' ) . long ( "random" )
@@ -113,7 +120,7 @@ pub fn build_args() -> Command {
113
120
. arg (
114
121
Arg :: new ( "interval" ) . short ( 'I' ) . long ( "interval" )
115
122
. value_name ( "INTERVAL_DURATION" )
116
- . help ( "Milliseconds between ARP requests" )
123
+ . help ( "Milliseconds between ARP requests (defaults to 10ms) " )
117
124
)
118
125
. arg (
119
126
Arg :: new ( "bandwidth" ) . short ( 'B' ) . long ( "bandwidth" )
@@ -124,17 +131,24 @@ pub fn build_args() -> Command {
124
131
. arg (
125
132
Arg :: new ( "oui-file" ) . long ( "oui-file" )
126
133
. value_name ( "FILE_PATH" )
127
- . help ( "Path to custom IEEE OUI CSV file" )
134
+ . default_value ( "/usr/share/arp-scan/ieee-oui.csv" )
135
+ . help ( "Path to custom IEEE OUI CSV file for vendor lookup" )
128
136
)
129
137
. arg (
130
138
Arg :: new ( "list" ) . short ( 'l' ) . long ( "list" )
131
139
. action ( ArgAction :: SetTrue )
132
140
. exclusive ( true )
133
- . help ( "List network interfaces" )
141
+ . help ( "List network interfaces and exit " )
134
142
)
135
143
. arg (
136
144
Arg :: new ( "output" ) . short ( 'o' ) . long ( "output" )
137
145
. value_name ( "FORMAT" )
146
+ . value_parser ( [
147
+ PossibleValue :: new ( "plain" ) . help ( "Verbose output with table" ) ,
148
+ PossibleValue :: new ( "json" ) . help ( "JSON format" ) ,
149
+ PossibleValue :: new ( "yaml" ) . help ( "YAML format" ) ,
150
+ PossibleValue :: new ( "csv" ) . help ( "CSV format" )
151
+ ] )
138
152
. help ( "Define output format" )
139
153
)
140
154
. arg (
@@ -166,7 +180,7 @@ pub fn build_args() -> Command {
166
180
Arg :: new ( "packet_help" ) . long ( "packet-help" )
167
181
. action ( ArgAction :: SetTrue )
168
182
. exclusive ( true )
169
- . help ( "Print details about an ARP packet" )
183
+ . help ( "Print details about an ARP packet and exit " )
170
184
)
171
185
. after_help ( EXAMPLES_HELP )
172
186
}
0 commit comments