bird_tool_utils_man/
environment.rs

1/// Arguments that are passed by the executing shell.
2#[derive(Debug, Clone)]
3pub struct Env {
4  pub(crate) name: String,
5  pub(crate) default: Option<String>,
6  pub(crate) help: Option<String>,
7}
8
9impl Env {
10  /// Create a new instance.
11  pub fn new(name: &str) -> Self {
12    Self {
13      name: name.into(),
14      default: None,
15      help: None,
16    }
17  }
18
19  /// Set the default value.
20  pub fn default_value(mut self, default: &str) -> Self {
21    self.default = Some(default.into());
22    self
23  }
24
25  /// Set the help.
26  pub fn help(mut self, help: &str) -> Self {
27    self.help = Some(help.into());
28    self
29  }
30}