just/src/setting.rs

38 lines
1.0 KiB
Rust
Raw Normal View History

use super::*;
2021-06-08 01:01:27 -07:00
#[derive(Debug, Clone)]
pub(crate) enum Setting<'src> {
2022-02-14 18:37:06 -08:00
AllowDuplicateRecipes(bool),
DotenvFilename(String),
DotenvLoad(bool),
DotenvPath(String),
Export(bool),
Fallback(bool),
IgnoreComments(bool),
PositionalArguments(bool),
Quiet(bool),
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>),
}
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 {
2022-02-14 18:37:06 -08:00
Setting::AllowDuplicateRecipes(value)
| Setting::DotenvLoad(value)
2022-01-18 11:02:15 -08:00
| Setting::Export(value)
| Setting::Fallback(value)
| Setting::IgnoreComments(value)
2022-01-18 11:02:15 -08:00
| Setting::PositionalArguments(value)
| Setting::Quiet(value)
2022-12-15 16:53:21 -08:00
| Setting::WindowsPowerShell(value) => write!(f, "{value}"),
Setting::Shell(shell) | Setting::WindowsShell(shell) => write!(f, "{shell}"),
Setting::DotenvFilename(value) | Setting::DotenvPath(value) | Setting::Tempdir(value) => {
write!(f, "{value:?}")
2022-10-25 16:57:20 -07:00
}
2021-06-08 01:01:27 -07:00
}
}
}