diff --git a/src/command.rs b/src/command.rs index 901ce17..3975f2e 100644 --- a/src/command.rs +++ b/src/command.rs @@ -132,13 +132,14 @@ impl Updater { } fn update(&self, sys: &System, opt: &Opt) -> Result<()> { - let steps = match &opt.steps { - Some(v) => v.iter().map(|u| u.into()).collect(), - None => vec![ + let steps = if opt.steps.is_empty() { + vec![ UpdateSteps::Fetch, UpdateSteps::Compile, UpdateSteps::Install, - ], + ] + } else { + opt.steps.iter().map(|u| u.into()).collect() }; if steps.contains(&UpdateSteps::Fetch) { diff --git a/src/lib.rs b/src/lib.rs index 27f76cb..5c72b97 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,9 +27,10 @@ pub struct Opt { pub yes: bool, #[arg(short, long)] - pub quiet: bool, + pub quiet: bool, // TODO: use clap_verbosity_flag instead + #[arg(short, long)] - pub steps: Option>, + pub steps: Vec, } pub fn run(opt: &Opt) {