dump config

This commit is contained in:
John Smith
2022-01-05 20:32:43 -05:00
parent 2eb598e68c
commit 3d744fb87e
4 changed files with 103 additions and 22 deletions
+14
View File
@@ -57,6 +57,11 @@ fn parse_command_line(default_config_path: &OsStr) -> Result<clap::ArgMatches, c
.default_value_os(default_config_path)
.help("Specify a configuration file to use"),
)
.arg(
Arg::with_name("dump-config")
.long("dump-config")
.help("Instead of running the server, print the configuration it would use to the console"),
)
.arg(
Arg::with_name("bootstrap")
.long("bootstrap")
@@ -244,6 +249,15 @@ pub async fn main() -> Result<(), String> {
clogwriter,
))
}
// --- Dump Config ---
if matches.occurrences_of("dump-config") != 0 {
//let cfg = config::Config::try_from(&*settingsr);
return serde_yaml::to_writer(std::io::stdout(), &*settingsr).map_err(|e| e.to_string());
}
// --- Normal Startup ---
CombinedLogger::init(logs).map_err(|e| format!("failed to init logs: {}", e))?;
// Create Veilid Core