Parse --shell option value as shell command

This commit is contained in:
rhysd authored and David Peter committed 2021-10-17 17:03:36 +02:00
1 parent 5c6879e4c1
commit e2fdaceb9f
7 files changed
+96 -20

No files matched your search

+6
View File
@@ -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)
}
}
}
}