scsys_xtask/pipes/watch/
config.rs1#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize), serde(default, rename_all = "snake_case"))]
7#[derive(Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
8#[cfg_attr(feature = "clap", derive(clap::Parser))]
9pub struct WatcherConfig {
10 #[cfg_attr(feature = "clap", clap(long, short))]
11 pub(crate) target: Option<String>,
12 #[cfg_attr(feature = "clap", clap(long, short))]
13 pub(crate) output: Option<String>,
14 #[cfg_attr(feature = "clap", clap(long, short))]
15 pub(crate) input: Option<String>,
16 #[cfg_attr(feature = "clap", arg(long, short, action = clap::ArgAction::SetTrue))]
17 pub(crate) verbose: bool,
18}
19
20impl WatcherConfig {
21 pub fn new() -> Self {
23 Self::default()
24 }
25
26 pub fn target(&self) -> Option<&String> {
28 self.target.as_ref()
29 }
30
31 pub fn output(&self) -> Option<&String> {
33 self.output.as_ref()
34 }
35
36 pub fn input(&self) -> Option<&String> {
38 self.input.as_ref()
39 }
40}