Skip to content
This repository was archived by the owner on Dec 10, 2022. It is now read-only.

Commit e2c7673

Browse files
committed
feat(config): add subcommand config
1 parent 4ef39c9 commit e2c7673

File tree

2 files changed

+7
-254
lines changed

2 files changed

+7
-254
lines changed

src/cli_config.rs

Lines changed: 0 additions & 253 deletions
This file was deleted.

src/node_config.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::collections::BTreeSet as Set;
66

77
use config::{Config, File as CfgFile};
88
use serde::de::{self, Deserialize, Deserializer};
9-
use clap::{App, AppSettings, Arg, ArgMatches};
9+
use clap::{App, AppSettings, Arg, SubCommand, ArgMatches};
1010
use hex::FromHex;
1111
use itertools::Itertools;
1212
use regex::Regex;
@@ -169,6 +169,12 @@ pub fn cli_parse() -> NodeConfig {
169169
.about(crate_description!())
170170
.setting(AppSettings::ColoredHelp)
171171
.setting(AppSettings::SubcommandsNegateReqs)
172+
.subcommand(SubCommand::with_name("config")
173+
.arg(Arg::with_name("cfg-file")
174+
.index(1)
175+
.help("Load settings from saved config file. \
176+
Config file format is YAML")
177+
.takes_value(true)))
172178
.arg(Arg::with_name("udp-address")
173179
.short("u")
174180
.long("udp-address")

0 commit comments

Comments
 (0)