add description argument option

This commit is contained in:
yggverse 2025-09-08 16:36:53 +03:00
parent e8e2369564
commit 0e79c21da6
2 changed files with 9 additions and 0 deletions

View file

@ -12,6 +12,10 @@ pub struct Config {
#[arg(short, long, default_value_t = String::from("βtracker"))] #[arg(short, long, default_value_t = String::from("βtracker"))]
pub name: String, pub name: String,
/// Server description
#[arg(short, long)]
pub description: Option<String>,
/// Date format /// Date format
#[arg(short, long, default_value_t = String::from("%Y/%m/%d"))] #[arg(short, long, default_value_t = String::from("%Y/%m/%d"))]
pub format_date: String, pub format_date: String,

View file

@ -278,7 +278,12 @@ fn index(config: &Config, public: &Public, page: Option<usize>) -> Result<String
b.push(format!("# {}\n", config.name)); b.push(format!("# {}\n", config.name));
if let Some(ref description) = config.description {
b.push(format!("{description}\n"));
}
if let Some(ref trackers) = config.tracker { if let Some(ref trackers) = config.tracker {
b.push(format!("## Connect\n"));
b.push("```".into()); b.push("```".into());
for tracker in trackers { for tracker in trackers {
b.push(tracker.to_string()); b.push(tracker.to_string());