structopt_flags/
force.rs

1use std::fmt;
2use structopt::StructOpt;
3
4#[derive(StructOpt, Debug, Clone)]
5pub struct ForceFlag {
6    /// Force the operation
7    #[structopt(name = "forceflag", long = "force", short = "f", global = true)]
8    pub force: bool,
9}
10
11impl fmt::Display for ForceFlag {
12    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
13        if self.force {
14            write!(f, "force: True")
15        } else {
16            write!(f, "force: False")
17        }
18    }
19}