mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-01 17:00:18 +00:00
add CLI option to identify a command with a custom name
CLI option `--name` can be used to define the name to identify a command. If not passed, then the command itself is used. Commands and names are paired in the same order: The first command executed gets the first name passed as option. Close #326
This commit is contained in:
1 parent
674b5422ab
commit
0f0a109ca0
4 files changed
+27
-2
No files matched your search
@@ -127,6 +127,10 @@ fn build_hyperfine_options(matches: &ArgMatches<'_>) -> Result<HyperfineOptions,
|
||||
(None, None) => {}
|
||||
};
|
||||
|
||||
options.names = matches
|
||||
.values_of("command-name")
|
||||
.map(|values| values.map(String::from).collect::<Vec<String>>());
|
||||
|
||||
options.preparation_command = matches
|
||||
.values_of("prepare")
|
||||
.map(|values| values.map(String::from).collect::<Vec<String>>());
|
||||
|
||||
Reference in new issue
Block a user