forked from lix-project/lix-installer
Tidy up plan / install UX
This commit is contained in:
parent
b123bbf285
commit
c22f92aee4
|
@ -29,7 +29,7 @@ pub struct Install {
|
|||
pub plan: Option<PathBuf>,
|
||||
|
||||
#[clap(subcommand)]
|
||||
pub planner: BuiltinPlanner,
|
||||
pub planner: Option<BuiltinPlanner>,
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
|
@ -43,6 +43,13 @@ impl CommandExecute for Install {
|
|||
explain,
|
||||
} = self;
|
||||
|
||||
let planner = match planner {
|
||||
Some(planner) => planner,
|
||||
None => BuiltinPlanner::default()
|
||||
.await
|
||||
.map_err(|e| eyre::eyre!(e))?,
|
||||
};
|
||||
|
||||
let mut plan = match &plan {
|
||||
Some(plan_path) => {
|
||||
let install_plan_string = tokio::fs::read_to_string(&plan_path)
|
||||
|
|
|
@ -9,11 +9,10 @@ use crate::cli::CommandExecute;
|
|||
|
||||
/// Plan an install that can be repeated on an identical host later
|
||||
#[derive(Debug, Parser)]
|
||||
#[command(args_conflicts_with_subcommands = true, arg_required_else_help = true)]
|
||||
pub struct Plan {
|
||||
#[clap(subcommand)]
|
||||
pub planner: Option<BuiltinPlanner>,
|
||||
#[clap(env = "HARMONIC_PLAN")]
|
||||
#[clap(env = "HARMONIC_PLAN", default_value = "/dev/stdout")]
|
||||
pub output: PathBuf,
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue