diff --git a/bin/bffhd/main.rs b/bin/bffhd/main.rs index 88874e9..6c89442 100644 --- a/bin/bffhd/main.rs +++ b/bin/bffhd/main.rs @@ -23,12 +23,12 @@ fn main() -> miette::Result<()> { build_kind=difluoroborane::env::BUILD_RUST_CHANNEL)) .about(clap::crate_description!()) .arg(Arg::new("config") - .help("Path to the config file to use") + .help("Path to the DHALL config file to use") .long("config") .short('c') .takes_value(true)) .arg(Arg::new("verbosity") - .help("Increase logging verbosity") + .help("Increase logging verbosity. Stackable from -v up to -vvv") .long("verbose") .short('v') .multiple_occurrences(true) @@ -47,18 +47,19 @@ fn main() -> miette::Result<()> { .arg(Arg::new("log level") .help("Set the desired log levels.") .long("log-level") - .takes_value(true)) + .takes_value(true) + .possible_values(["info", "warn", "error", "debug", "trace"])) .arg( Arg::new("print default") - .help("Print a default config to stdout instead of running") + .help("Print a default DHALL config to stdout instead of running") .long("print-default")) .arg( Arg::new("check config") - .help("Check config for validity") + .help("Check DHALL config for validity") .long("check")) .arg( Arg::new("dump-db") - .help("Dump all internal databases") + .help("Dump all internal databases (states and users) to the given file as TOML") .long("dump-db") .alias("dump") .conflicts_with("dump-users") @@ -83,29 +84,31 @@ fn main() -> miette::Result<()> { ) .arg( Arg::new("force") - .help("force ops that may clobber") + .help("Force owerwriting existing files") .long("force") ) .arg( Arg::new("load-users") - .help("Load users into the internal databases") + .help("Load users from TOML into the internal databases") .long("load-users") .alias("load") .takes_value(true) + .value_name("FILE") .conflicts_with("dump-db") .conflicts_with("load-db") .conflicts_with("dump-users") ) .arg( Arg::new("load-db") - .help("Load values into the internal databases") + .help("Load values from TOML into the internal databases") .long("load-db") .takes_value(true) + .value_name("FILE") .conflicts_with("dump-db") .conflicts_with("load-users") .conflicts_with("dump-users")) .arg(Arg::new("keylog") - .help("log TLS keys into PATH. If no path is specified the value of the envvar SSLKEYLOGFILE is used.") + .help("Log TLS keys into PATH. If no path is specified the value of the envvar SSLKEYLOGFILE is used.") .long("tls-key-log") .value_name("PATH") .takes_value(true) @@ -119,9 +122,7 @@ fn main() -> miette::Result<()> { Err(error) => error.exit(), }; - let configpath = matches - .value_of("config") - .unwrap_or("/etc/difluoroborane.dhall"); + let configpath = matches.value_of("config").unwrap_or("/etc/bffh/bffh.dhall"); // Check for the --print-default option first because we don't need to do anything else in that // case. @@ -130,7 +131,7 @@ fn main() -> miette::Result<()> { let encoded = serde_dhall::serialize(&config).to_string().unwrap(); // Direct writing to fd 1 is faster but also prevents any print-formatting that could - // invalidate the generated TOML + // invalidate the generated DHALL let stdout = io::stdout(); let mut handle = stdout.lock(); handle.write_all(encoded.as_bytes()).unwrap();