forked from katzen-cafe/iowo
app(doc): well... write the docs
This commit is contained in:
parent
6006f92d9c
commit
0615ea653c
5 changed files with 25 additions and 6 deletions
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue