From b96e6b25136210204ad7351c23dc36a6418e30c6 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Mon, 13 Mar 2023 10:41:52 -0700 Subject: [PATCH] Make `nix-installer plan invalid-plan` fail (#331) * Make `nix-installer plan invalid-plan` fail Prior to this change, the `invalid-plan` would unexpectedly be interpreted as the output path. Now there is a flag to specify where the plan should be written to. * use `out-file` and `NIX_INSTALLER_PLAN_OUT_FILE` --- src/cli/subcommand/plan.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cli/subcommand/plan.rs b/src/cli/subcommand/plan.rs index 9fb9356..2666487 100644 --- a/src/cli/subcommand/plan.rs +++ b/src/cli/subcommand/plan.rs @@ -13,7 +13,12 @@ use crate::cli::CommandExecute; pub struct Plan { #[clap(subcommand)] pub planner: Option, - #[clap(env = "NIX_INSTALLER_PLAN", default_value = "/dev/stdout")] + /// Where to write the generated plan (in JSON format) + #[clap( + long = "out-file", + env = "NIX_INSTALLER_PLAN_OUT_FILE", + default_value = "/dev/stdout" + )] pub output: PathBuf, }