mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-02 09:01:25 +00:00
Fix usage of --input=null
This commit is contained in:
1 parent
fbe9ca6669
commit
80ec1c5ddf
2 files changed
+17
-6
No files matched your search
@@ -15,6 +15,13 @@
|
|||||||
## Other
|
## Other
|
||||||
|
|
||||||
|
|
||||||
|
# v1.16.1
|
||||||
|
|
||||||
|
## Bugfixes
|
||||||
|
|
||||||
|
- Fix line-wrapping of `--help` text (@sharkdp)
|
||||||
|
- Fix `--input=null` (@sharkdp)
|
||||||
|
|
||||||
|
|
||||||
# v1.16.0
|
# v1.16.0
|
||||||
|
|
||||||
|
|||||||
+10
-6
@@ -379,13 +379,17 @@ impl Options {
|
|||||||
}
|
}
|
||||||
|
|
||||||
options.command_input_policy = if let Some(path_str) = matches.get_one::<String>("input") {
|
options.command_input_policy = if let Some(path_str) = matches.get_one::<String>("input") {
|
||||||
let path = PathBuf::from(path_str);
|
if path_str == "null" {
|
||||||
if !path.exists() {
|
CommandInputPolicy::Null
|
||||||
return Err(OptionsError::StdinDataFileDoesNotExist(
|
} else {
|
||||||
path_str.to_string(),
|
let path = PathBuf::from(path_str);
|
||||||
));
|
if !path.exists() {
|
||||||
|
return Err(OptionsError::StdinDataFileDoesNotExist(
|
||||||
|
path_str.to_string(),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
CommandInputPolicy::File(path)
|
||||||
}
|
}
|
||||||
CommandInputPolicy::File(path)
|
|
||||||
} else {
|
} else {
|
||||||
CommandInputPolicy::Null
|
CommandInputPolicy::Null
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user