add usage help to generated config (#527)
This commit is contained in:
parent
a453edd91c
commit
67718898c5
|
@ -64,6 +64,9 @@ impl Configurable<ZebradConfig> for ZebradCmd {
|
|||
let if_exists = |f: PathBuf| if f.exists() { Some(f) } else { None };
|
||||
|
||||
filename.and_then(if_exists)
|
||||
|
||||
// Note: Changes in how configuration is loaded may need usage
|
||||
// edits in generate.rs
|
||||
}
|
||||
|
||||
/// Apply changes to the config after it's been loaded, e.g. overriding
|
||||
|
|
|
@ -31,8 +31,20 @@ impl Runnable for GenerateCmd {
|
|||
# can be found in Rustdoc here:
|
||||
# https://doc.zebra.zfnd.org/zebrad/config/struct.ZebradConfig.html
|
||||
|
||||
# Usage:
|
||||
# One option is to locate this file in the same directory the zebrad binary is
|
||||
# called from, if the default name zebrad.toml is used the app will load the new
|
||||
# configuration automatically. For example if you generate with:
|
||||
# zebrad generate -o zebrad.toml
|
||||
# Edit the file as needed then execute the following to connect using
|
||||
# the new configuration, default values will be overwritten:
|
||||
# zebrad connect
|
||||
# If you generated with a different name or location then -c flag is required
|
||||
# to load the new configuration:
|
||||
# zebrad generate -o myzebrad.toml
|
||||
# zebrad -c myzebrad.toml connect
|
||||
"
|
||||
.to_owned(); // The default name and location of the config file is defined in ../commands.rs
|
||||
.to_owned();
|
||||
|
||||
// this avoids a ValueAfterTable error
|
||||
// https://github.com/alexcrichton/toml-rs/issues/145
|
||||
|
|
Loading…
Reference in New Issue