hooked/hooked-config/source/config/general.rs

36 lines
821 B
Rust
Raw Normal View History

2022-10-28 10:23:05 +00:00
//! General configuration definitions.
use std::path::PathBuf;
use serde::{Deserialize, Serialize};
use crate::NoiseLevel;
2022-10-28 10:23:05 +00:00
/// General Hooked configuration.
#[derive(Debug, Deserialize, Serialize)]
#[serde(default, deny_unknown_fields)]
pub struct General {
2022-11-01 12:38:52 +00:00
/// Path to the Hooked configuration file.
pub config: PathBuf,
2022-10-28 10:23:05 +00:00
/// The directory to use for hooks.
pub directory: PathBuf,
2022-11-04 18:00:09 +00:00
/// The noise level tasks should output logs with by default.
pub noise_level: NoiseLevel,
2022-11-04 18:00:09 +00:00
/// Path to a script template for use with the install subcommand.
pub template: Option<PathBuf>,
2022-10-28 10:23:05 +00:00
}
impl Default for General {
fn default() -> Self {
Self {
2022-11-01 12:38:52 +00:00
config: PathBuf::from("Hooked.toml"),
2022-10-28 10:23:05 +00:00
directory: PathBuf::from("hooks"),
noise_level: NoiseLevel::default(),
2022-11-04 18:00:09 +00:00
template: None,
2022-10-28 10:23:05 +00:00
}
}
}