mirror of
https://github.com/YGGverse/btracker.git
synced 2026-03-31 17:15:31 +00:00
implement print_version argument option
This commit is contained in:
parent
e493ecdc36
commit
4fd41feeaa
3 changed files with 11 additions and 1 deletions
|
|
@ -27,6 +27,7 @@ pub struct Meta {
|
|||
pub title: String,
|
||||
/// * use vector to keep the order from the arguments list
|
||||
pub trackers: Option<Vec<Url>>,
|
||||
pub version: Option<String>,
|
||||
}
|
||||
|
||||
#[get("/?<page>")]
|
||||
|
|
@ -130,6 +131,11 @@ fn rocket() -> _ {
|
|||
format_time: config.format_time,
|
||||
title: config.title,
|
||||
trackers: config.tracker,
|
||||
version: if config.print_version {
|
||||
Some(env!("CARGO_PKG_VERSION").into())
|
||||
} else {
|
||||
None
|
||||
},
|
||||
})
|
||||
.mount("/", FileServer::from(config.statics))
|
||||
.mount("/", routes![index, rss])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue