Skip to content

Commit 02fde86

Browse files
committed
Fix binary name in help message for test binaries
1 parent e98ae97 commit 02fde86

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: test/src/cli.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ Test Attributes:
196196
pub fn parse_opts(args: &[String]) -> Option<OptRes> {
197197
// Parse matches.
198198
let opts = optgroups();
199+
let binary = args.get(0).map(|c| &**c).unwrap_or("...");
199200
let args = args.get(1..).unwrap_or(args);
200201
let matches = match opts.parse(args) {
201202
Ok(m) => m,
@@ -205,7 +206,7 @@ pub fn parse_opts(args: &[String]) -> Option<OptRes> {
205206
// Check if help was requested.
206207
if matches.opt_present("h") {
207208
// Show help and do nothing more.
208-
usage(&args[0], &opts);
209+
usage(binary, &opts);
209210
return None;
210211
}
211212

0 commit comments

Comments
 (0)