mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-10-30 00:38:56 +00:00
Parse --shell option value as shell command
This commit is contained in:
1 parent
5c6879e4c1
commit
e2fdaceb9f
7 files changed
+96
-20
No files matched your search
@@ -62,6 +62,8 @@ pub enum OptionsError<'a> {
|
||||
TooManyCommandNames(usize),
|
||||
UnexpectedCommandNameCount(usize, usize),
|
||||
NumericParsingError(&'a str, ParseIntError),
|
||||
EmptyShell,
|
||||
ShellParseError(shell_words::ParseError),
|
||||
}
|
||||
|
||||
impl<'a> fmt::Display for OptionsError<'a> {
|
||||
@@ -85,6 +87,10 @@ impl<'a> fmt::Display for OptionsError<'a> {
|
||||
cmd = cmd,
|
||||
err = err
|
||||
),
|
||||
OptionsError::EmptyShell => write!(f, "Empty command at --shell option"),
|
||||
OptionsError::ShellParseError(ref err) => {
|
||||
write!(f, "Could not parse --shell value as command line: {}", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user