diff --git a/crates/pop-cli/src/commands/new/parachain.rs b/crates/pop-cli/src/commands/new/parachain.rs index 737b0808..62998e9e 100644 --- a/crates/pop-cli/src/commands/new/parachain.rs +++ b/crates/pop-cli/src/commands/new/parachain.rs @@ -1,28 +1,35 @@ // SPDX-License-Identifier: GPL-3.0 use crate::style::{style, Theme}; use anyhow::Result; -use clap::Args; +use clap::{ + builder::{PossibleValue, PossibleValuesParser, TypedValueParser}, + Args, +}; use std::{ fs, path::{Path, PathBuf}, + str::FromStr, }; use cliclack::{clear_screen, confirm, input, intro, log, outro, outro_cancel, set_theme}; use pop_parachains::{instantiate_template_dir, Config, Git, GitHub, Provider, Release, Template}; +use strum::VariantArray; #[derive(Args)] pub struct NewParachainCommand { #[arg(help = "Name of the project. If empty assistance in the process will be provided.")] pub(crate) name: Option, #[arg( - help = "Template provider. Options are pop or parity (deprecated).", - default_value = "pop" + help = "Template provider.", + default_value = Provider::Pop.as_ref(), + value_parser = crate::enum_variants!(Provider) )] pub(crate) provider: Option, #[arg( short = 't', long, - help = "Template to use: 'base' for Pop and 'cpt' and 'fpt' for Parity templates" + help = "Template to use.", + value_parser = crate::enum_variants!(Template) )] pub(crate) template: Option