We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e98ae97 commit 02fde86Copy full SHA for 02fde86
test/src/cli.rs
@@ -196,6 +196,7 @@ Test Attributes:
196
pub fn parse_opts(args: &[String]) -> Option<OptRes> {
197
// Parse matches.
198
let opts = optgroups();
199
+ let binary = args.get(0).map(|c| &**c).unwrap_or("...");
200
let args = args.get(1..).unwrap_or(args);
201
let matches = match opts.parse(args) {
202
Ok(m) => m,
@@ -205,7 +206,7 @@ pub fn parse_opts(args: &[String]) -> Option<OptRes> {
205
206
// Check if help was requested.
207
if matches.opt_present("h") {
208
// Show help and do nothing more.
- usage(&args[0], &opts);
209
+ usage(binary, &opts);
210
return None;
211
}
212
0 commit comments