2022-06-18 21:56:31 -07:00
|
|
|
use super::*;
|
2019-11-10 23:17:47 -08:00
|
|
|
|
2021-06-08 01:01:27 -07:00
|
|
|
#[derive(Debug, Clone)]
|
2019-11-10 23:17:47 -08:00
|
|
|
pub(crate) enum Setting<'src> {
|
2022-02-14 18:37:06 -08:00
|
|
|
AllowDuplicateRecipes(bool),
|
2024-05-14 18:39:42 -07:00
|
|
|
AllowDuplicateVariables(bool),
|
2023-10-11 22:04:46 -07:00
|
|
|
DotenvFilename(String),
|
2021-03-28 22:38:07 -07:00
|
|
|
DotenvLoad(bool),
|
2023-10-11 22:04:46 -07:00
|
|
|
DotenvPath(String),
|
2021-04-24 18:29:58 -07:00
|
|
|
Export(bool),
|
2022-10-19 19:00:09 -07:00
|
|
|
Fallback(bool),
|
|
|
|
IgnoreComments(bool),
|
2021-04-24 18:29:58 -07:00
|
|
|
PositionalArguments(bool),
|
2024-01-12 12:38:23 -08:00
|
|
|
Quiet(bool),
|
2021-04-24 18:29:58 -07:00
|
|
|
Shell(Shell<'src>),
|
2022-10-25 16:57:20 -07:00
|
|
|
Tempdir(String),
|
2022-01-18 11:02:15 -08:00
|
|
|
WindowsPowerShell(bool),
|
2022-05-31 13:01:59 -07:00
|
|
|
WindowsShell(Shell<'src>),
|
2019-11-10 23:17:47 -08:00
|
|
|
}
|
2021-06-08 01:01:27 -07:00
|
|
|
|
|
|
|
impl<'src> Display for Setting<'src> {
|
|
|
|
fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> {
|
|
|
|
match self {
|
2024-05-14 20:07:41 -07:00
|
|
|
Self::AllowDuplicateRecipes(value)
|
|
|
|
| Self::AllowDuplicateVariables(value)
|
|
|
|
| Self::DotenvLoad(value)
|
|
|
|
| Self::Export(value)
|
|
|
|
| Self::Fallback(value)
|
|
|
|
| Self::IgnoreComments(value)
|
|
|
|
| Self::PositionalArguments(value)
|
|
|
|
| Self::Quiet(value)
|
|
|
|
| Self::WindowsPowerShell(value) => write!(f, "{value}"),
|
|
|
|
Self::Shell(shell) | Self::WindowsShell(shell) => write!(f, "{shell}"),
|
|
|
|
Self::DotenvFilename(value) | Self::DotenvPath(value) | Self::Tempdir(value) => {
|
2023-10-11 22:04:46 -07:00
|
|
|
write!(f, "{value:?}")
|
2022-10-25 16:57:20 -07:00
|
|
|
}
|
2021-06-08 01:01:27 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|