Skip to content

Commit

Permalink
Merge pull request #4012 from eval-exec/exec/fix-ckb-init-chain-possi…
Browse files Browse the repository at this point in the history
…able-values

Fix: `ckb init` creates config files even when an unsupported spec is specified.
  • Loading branch information
zhangsoledad authored Jun 15, 2023
2 parents 6501fd4 + e78621b commit 8ca2f19
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion util/app-config/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! CKB command line arguments parser.
use ckb_build_info::Version;
use ckb_resource::{DEFAULT_P2P_PORT, DEFAULT_RPC_PORT, DEFAULT_SPEC};
use ckb_resource::{AVAILABLE_SPECS, DEFAULT_P2P_PORT, DEFAULT_RPC_PORT, DEFAULT_SPEC};
use clap::{Arg, ArgGroup, ArgMatches, Command};

/// binary file name(ckb)
Expand Down Expand Up @@ -414,6 +414,12 @@ fn init() -> Command {
Arg::new(ARG_CHAIN)
.short('c')
.long(ARG_CHAIN)
.value_parser(
AVAILABLE_SPECS
.iter()
.map(|v| v.to_string())
.collect::<Vec<_>>(),
)
.default_value(DEFAULT_SPEC)
.help("Initializes CKB directory for <chain>"),
)
Expand Down

0 comments on commit 8ca2f19

Please sign in to comment.