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`
This commit is contained in:
Cole Helbling 2023-03-13 10:41:52 -07:00 committed by GitHub
parent 88eca9eb9c
commit b96e6b2513
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,7 +13,12 @@ use crate::cli::CommandExecute;
pub struct Plan {
#[clap(subcommand)]
pub planner: Option<BuiltinPlanner>,
#[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,
}