From 00ffe96aaecafa100f4f24d6993528fc94b1d91b Mon Sep 17 00:00:00 2001 From: Ana Hobden Date: Tue, 8 Nov 2022 10:20:48 -0800 Subject: [PATCH] Refine plan subcommand UX --- src/cli/subcommand/plan.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cli/subcommand/plan.rs b/src/cli/subcommand/plan.rs index 96cdd43..41c3796 100644 --- a/src/cli/subcommand/plan.rs +++ b/src/cli/subcommand/plan.rs @@ -9,19 +9,19 @@ use crate::cli::CommandExecute; /// Plan an install that can be repeated on an identical host later #[derive(Debug, Parser)] -#[command(multicall = true)] +#[command(args_conflicts_with_subcommands = true, arg_required_else_help = true)] pub struct Plan { #[clap(subcommand)] pub planner: Option, #[clap(env = "HARMONIC_PLAN")] - pub plan: PathBuf, + pub output: PathBuf, } #[async_trait::async_trait] impl CommandExecute for Plan { #[tracing::instrument(skip_all, fields())] async fn execute(self) -> eyre::Result { - let Self { planner, plan } = self; + let Self { planner, output } = self; let planner = match planner { Some(planner) => planner, @@ -33,7 +33,7 @@ impl CommandExecute for Plan { let install_plan = planner.plan().await.map_err(|e| eyre::eyre!(e))?; let json = serde_json::to_string_pretty(&install_plan)?; - tokio::fs::write(plan, json) + tokio::fs::write(output, json) .await .wrap_err("Writing plan")?;