Use structopt

This commit is contained in:
Roey Darwish Dror
2018-09-06 14:42:56 +03:00
parent 993dec166f
commit 682d4445b7
4 changed files with 87 additions and 66 deletions

View File

@@ -44,3 +44,22 @@ impl Config {
&self.git_repos
}
}
#[derive(StructOpt, Debug)]
#[structopt(name = "Topgrade")]
pub struct Opt {
#[structopt(short = "t", long = "tmux", help = "Run inside tmux")]
pub run_in_tmux: bool,
#[structopt(long = "no-system", help = "Don't perform system upgrade")]
pub no_system: bool,
#[structopt(long = "no-git-repos", help = "Don't perform updates on configured git repos")]
pub no_git_repos: bool,
#[structopt(long = "no-emacs", help = "Don't upgrade Emacs packages or configuration files")]
pub no_emacs: bool,
#[structopt(short = "n", long = "dry-run", help = "Print what would be done")]
pub dry_run: bool,
}