From a24f5304c03148e1ab2c8fa6527cca6ff9b102ee Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Fri, 04 Dec 2020 08:33:37 +0000 Subject: [PATCH] feat(build-systems): --skip option --- --- a/src/cmds/build_systems.rs +++ b/src/cmds/build_systems.rs @@ -10,10 +10,14 @@ use log::{info, warn}; #[derive(Clap)] +#[clap(group = clap::ArgGroup::new("target"))] pub struct BuildSystems { /// Hosts to skip - #[clap(long, number_of_values = 1)] + #[clap(long, number_of_values = 1, group = "target")] skip: Vec, + /// Hosts to build + #[clap(long, number_of_values = 1, group = "target")] + only: Vec, /// Host, which should be threaten as localhost #[clap(long, env = "FLEET_LOCALHOST")] localhost: Option, @@ -59,7 +63,7 @@ let data = SecretDb::open(&db)?.generate_nix_data()?; for host in hosts.iter() { - if self.skip.contains(host) { + if self.only.len() > 0 && !self.only.contains(host) || self.skip.contains(host) { warn!("Skipping host {}", host); continue; } -- gitstuff