Simplify "steps" argument
This commit is contained in:
parent
088eb42521
commit
088cd97b19
@ -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) {
|
||||
|
@ -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<Vec<String>>,
|
||||
pub steps: Vec<String>,
|
||||
}
|
||||
|
||||
pub fn run(opt: &Opt) {
|
||||
|
Loading…
Reference in New Issue
Block a user