diff options
Diffstat (limited to 'src/bin/vmadm.rs')
-rw-r--r-- | src/bin/vmadm.rs | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/src/bin/vmadm.rs b/src/bin/vmadm.rs index 4cc2248..8fe5540 100644 --- a/src/bin/vmadm.rs +++ b/src/bin/vmadm.rs @@ -57,17 +57,6 @@ enum Command { #[structopt(parse(from_os_str))] dirname: PathBuf, }, - - CloudInitIso { - #[structopt(flatten)] - common: CommonOptions, - - #[structopt(parse(from_os_str))] - spec: PathBuf, - - #[structopt(parse(from_os_str))] - iso: PathBuf, - }, } #[derive(StructOpt, Debug)] @@ -83,8 +72,8 @@ fn main() -> anyhow::Result<()> { match cli.cmd { Command::New { common, spec } => { - let spec = get_spec(&common, &spec)?; - cmd::new(&spec)?; + let specs = get_specs(&common, &spec)?; + cmd::new(&specs)?; } Command::List { common } => { @@ -93,8 +82,8 @@ fn main() -> anyhow::Result<()> { } Command::Delete { common, spec } => { - let spec = get_spec(&common, &spec)?; - cmd::delete(&spec)?; + let specs = get_specs(&common, &spec)?; + cmd::delete(&specs)?; } Command::CloudInit { @@ -102,21 +91,17 @@ fn main() -> anyhow::Result<()> { spec, dirname, } => { - let spec = get_spec(&common, &spec)?; - cmd::cloud_init(&spec, &dirname)?; - } - Command::CloudInitIso { common, spec, iso } => { - let spec = get_spec(&common, &spec)?; - cmd::cloud_init_iso(&spec, &iso)?; + let specs = get_specs(&common, &spec)?; + cmd::cloud_init(&specs, &dirname)?; } } Ok(()) } -fn get_spec(common: &CommonOptions, spec: &Path) -> anyhow::Result<Specification> { +fn get_specs(common: &CommonOptions, spec: &Path) -> anyhow::Result<Vec<Specification>> { let config = config(&common)?; - let spec = Specification::from_file(&config, &spec)?; - Ok(spec) + let specs = Specification::from_file(&config, &spec)?; + Ok(specs) } fn config(common: &CommonOptions) -> anyhow::Result<Configuration> { |