man/
flag.rs

1/// Boolean arguments that can be toggled on or off.
2#[derive(Debug, Clone, Default)]
3pub struct Flag {
4  pub(crate) short: Option<String>,
5  pub(crate) long: Option<String>,
6  pub(crate) help: Option<String>,
7}
8
9impl Flag {
10  /// Create a new instance.
11  pub fn new() -> Self {
12    Self::default()
13  }
14
15  /// Set the short value.
16  pub fn short(mut self, short: &str) -> Self {
17    self.short = Some(short.into());
18    self
19  }
20
21  /// Set the long value.
22  pub fn long(mut self, long: &str) -> Self {
23    self.long = Some(long.into());
24    self
25  }
26
27  /// Set the help value.
28  pub fn help(mut self, help: &str) -> Self {
29    self.help = Some(help.into());
30    self
31  }
32}