forked from discord/hal-9000
45 lines
1.6 KiB
Rust
45 lines
1.6 KiB
Rust
|
|
#[macro_use] extern crate log;
|
||
|
|
|
||
|
|
pub mod hal;
|
||
|
|
|
||
|
|
use clap::{Command, crate_version, Arg};
|
||
|
|
|
||
|
|
// Retrieve build info from output file
|
||
|
|
pub mod built_info {
|
||
|
|
include!(concat!(env!("OUT_DIR"), "/built.rs"));
|
||
|
|
}
|
||
|
|
|
||
|
|
fn main() {
|
||
|
|
|
||
|
|
env_logger::init();
|
||
|
|
|
||
|
|
let git_info: String = built_info::GIT_VERSION.unwrap_or("unknown").to_string();
|
||
|
|
|
||
|
|
info!("Hal 9000 Bot version {}({}) starting up...", built_info::PKG_VERSION, git_info);
|
||
|
|
|
||
|
|
let matches = Command::new("HAL 9000 Bot, Discord Edition")
|
||
|
|
.version(crate_version!())
|
||
|
|
.author("Xyon <xyon@orbiter-radio.uk>")
|
||
|
|
.about("General-Purpose bot originally for the Escape Pod 14 Discord Server using the Manifold framework.")
|
||
|
|
.about("General-Purpose bot for the Escape Pod 14 Discord Server using the Manifold framework.")
|
||
|
|
.arg(Arg::new("config-file")
|
||
|
|
.short('c')
|
||
|
|
.long("config-file")
|
||
|
|
.value_name("FILE")
|
||
|
|
.default_value("hal.json")
|
||
|
|
.help("Path to the config file to use, relative to the 'config/' subdirectory beneath the binary path. Defaults to config/development.hal.json."))
|
||
|
|
.arg(Arg::new("environment")
|
||
|
|
.short('e')
|
||
|
|
.long("environment")
|
||
|
|
.value_name("ENV")
|
||
|
|
.default_value("Production")
|
||
|
|
.help("Bot environment to use. Determines which config settings are read. Defaults to Production."))
|
||
|
|
.arg(Arg::new("locale")
|
||
|
|
.short('l')
|
||
|
|
.default_value("en")
|
||
|
|
.help("Bot locale to run in, en and de currently supported"))
|
||
|
|
.get_matches();
|
||
|
|
|
||
|
|
hal::run(matches);
|
||
|
|
}
|