release_manager/
commandline.rs1#[derive(StructOpt, Debug)]
17#[structopt(name = "release-manager",
18 about = "A utility for creating release binaries for multiple platforms")]
19pub struct Opt {
20 #[structopt(short = "f", long = "force", help = "Force recompiling of succeeded builds")]
21 force_compile: bool,
22 #[structopt(long = "skip-dependencies", help = "Don't compile dependencies unless needed")]
23 skip_dependencies: bool,
24 #[structopt(short = "p", long = "publish", help = "Publish to crates.io on succesfull build")]
25 publish: bool,
26 #[structopt(long = "verbose", help = "Print debug info")]
27 verbose: bool,
28 #[structopt(short = "r", long = "release-config",
29 help = "Provide an alternative path for the release config")]
30 release_config: Option<String>,
31 #[structopt(short = "s", long = "status-file",
32 help = "Provide an alternative path for the status file")]
33 status_file: Option<String>,
34}
35
36impl Opt {
37 pub fn force_compile(&self) -> bool {
38 self.force_compile
39 }
40
41 pub fn publish(&self) -> bool {
42 self.publish
43 }
44
45 pub fn verbose(&self) -> bool {
46 self.verbose
47 }
48
49 pub fn skip_dependencies(&self) -> bool {
50 self.skip_dependencies
51 }
52
53 pub fn release_config(&self) -> Option<&str> {
54 match self.release_config {
55 Some(ref rc) => Some(rc),
56 None => None,
57 }
58 }
59
60 pub fn status_file(&self) -> Option<&str> {
61 match self.status_file {
62 Some(ref rc) => Some(rc),
63 None => None,
64 }
65 }
66}