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