mirror of
https://github.com/sharkdp/hyperfine.git
synced 2024-11-22 03:17:24 +03:00
Fix usage of --input=null
This commit is contained in:
parent
fbe9ca6669
commit
80ec1c5ddf
@ -15,6 +15,13 @@
|
||||
## Other
|
||||
|
||||
|
||||
# v1.16.1
|
||||
|
||||
## Bugfixes
|
||||
|
||||
- Fix line-wrapping of `--help` text (@sharkdp)
|
||||
- Fix `--input=null` (@sharkdp)
|
||||
|
||||
|
||||
# v1.16.0
|
||||
|
||||
|
@ -379,13 +379,17 @@ impl Options {
|
||||
}
|
||||
|
||||
options.command_input_policy = if let Some(path_str) = matches.get_one::<String>("input") {
|
||||
let path = PathBuf::from(path_str);
|
||||
if !path.exists() {
|
||||
return Err(OptionsError::StdinDataFileDoesNotExist(
|
||||
path_str.to_string(),
|
||||
));
|
||||
if path_str == "null" {
|
||||
CommandInputPolicy::Null
|
||||
} else {
|
||||
let path = PathBuf::from(path_str);
|
||||
if !path.exists() {
|
||||
return Err(OptionsError::StdinDataFileDoesNotExist(
|
||||
path_str.to_string(),
|
||||
));
|
||||
}
|
||||
CommandInputPolicy::File(path)
|
||||
}
|
||||
CommandInputPolicy::File(path)
|
||||
} else {
|
||||
CommandInputPolicy::Null
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user