app(doc): well... write the docs

This commit is contained in:
Schrottkatze 2024-01-19 09:51:48 +01:00
parent 6006f92d9c
commit 0615ea653c
Signed by: schrottkatze
GPG key ID: DFD0FD205943C14A
5 changed files with 25 additions and 6 deletions

View file

@ -7,6 +7,9 @@ pub(crate) struct Args {
/// Read this config file.
#[arg(short, long)]
pub config_path: Option<PathBuf>,
/// Turn off the startup message.
///
/// The startup message is not constant and depends on the time.
#[arg(long, env = "NO_STARTUP_MESSAGE", default_value = "false")]
pub no_startup_message: bool,
}

View file

@ -11,7 +11,7 @@ use super::error::ConfigError;
pub struct Configs {
#[serde(default = "default_example_value")]
pub example_value: i32,
#[serde(default = "default_no_startup_msg")]
#[serde(default)]
pub no_startup_message: bool,
}
@ -20,10 +20,7 @@ fn default_example_value() -> i32 {
43
}
fn default_no_startup_msg() -> bool {
false
}
/// Find the location of a config file and check if there is, in fact, a file
pub(super) fn find_config_file() -> Result<PathBuf, ConfigError> {
let Some(config_path) = dirs::config_dir() else {
return Err(ConfigError::NoConfigDir);