pub_just/
setting.rs

1use super::*;
2
3#[derive(Debug, Clone)]
4pub enum Setting<'src> {
5  AllowDuplicateRecipes(bool),
6  AllowDuplicateVariables(bool),
7  DotenvFilename(StringLiteral<'src>),
8  DotenvLoad(bool),
9  DotenvPath(StringLiteral<'src>),
10  DotenvRequired(bool),
11  Export(bool),
12  Fallback(bool),
13  IgnoreComments(bool),
14  PositionalArguments(bool),
15  Quiet(bool),
16  ScriptInterpreter(Interpreter<'src>),
17  Shell(Interpreter<'src>),
18  Tempdir(StringLiteral<'src>),
19  Unstable(bool),
20  WindowsPowerShell(bool),
21  WindowsShell(Interpreter<'src>),
22  WorkingDirectory(StringLiteral<'src>),
23}
24
25impl<'src> Display for Setting<'src> {
26  fn fmt(&self, f: &mut Formatter) -> fmt::Result {
27    match self {
28      Self::AllowDuplicateRecipes(value)
29      | Self::AllowDuplicateVariables(value)
30      | Self::DotenvLoad(value)
31      | Self::DotenvRequired(value)
32      | Self::Export(value)
33      | Self::Fallback(value)
34      | Self::IgnoreComments(value)
35      | Self::PositionalArguments(value)
36      | Self::Quiet(value)
37      | Self::Unstable(value)
38      | Self::WindowsPowerShell(value) => write!(f, "{value}"),
39      Self::ScriptInterpreter(shell) | Self::Shell(shell) | Self::WindowsShell(shell) => {
40        write!(f, "[{shell}]")
41      }
42      Self::DotenvFilename(value)
43      | Self::DotenvPath(value)
44      | Self::Tempdir(value)
45      | Self::WorkingDirectory(value) => {
46        write!(f, "{value}")
47      }
48    }
49  }
50}