mirror of
https://git.mentality.rip/numas13/xash3d-master.git
synced 2025-01-22 04:44:31 +00:00
master: add cmd line option to dump default config
This commit is contained in:
parent
8cf76e55ac
commit
501bb7217b
@ -63,6 +63,7 @@ pub fn parse() -> Result<Cli, Error> {
|
|||||||
);
|
);
|
||||||
opts.optopt("p", "port", &port_help, "PORT");
|
opts.optopt("p", "port", &port_help, "PORT");
|
||||||
opts.optopt("c", "config", "config path", "PATH");
|
opts.optopt("c", "config", "config path", "PATH");
|
||||||
|
opts.optflag("", "dump-config", "print default config");
|
||||||
opts.optopt("s", "stats-format", "stats format string", "FMT");
|
opts.optopt("s", "stats-format", "stats format string", "FMT");
|
||||||
opts.optopt("I", "stats-interval", "stats interval", "SECONDS");
|
opts.optopt("I", "stats-interval", "stats interval", "SECONDS");
|
||||||
|
|
||||||
@ -78,6 +79,11 @@ pub fn parse() -> Result<Cli, Error> {
|
|||||||
process::exit(0);
|
process::exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if matches.opt_present("dump-config") {
|
||||||
|
println!("{}", include_str!("../config/default.toml"));
|
||||||
|
process::exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(value) = matches.opt_str("log") {
|
if let Some(value) = matches.opt_str("log") {
|
||||||
match config::parse_log_level(value.as_ref()) {
|
match config::parse_log_level(value.as_ref()) {
|
||||||
Some(level) => cli.log_level = Some(level),
|
Some(level) => cli.log_level = Some(level),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user