mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Actually verify user credentials
This commit is contained in:
28
auth/src/common/cli.rs
Normal file
28
auth/src/common/cli.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
use clap::Parser;
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
#[command(version, about, long_about = None)]
|
||||
pub struct CliArgs {
|
||||
#[cfg(feature = "robocraft")]
|
||||
/// Robocraft user data root
|
||||
#[arg(long, default_value_t = {"../data/robocraft".to_string()})]
|
||||
pub data_robocraft: String,
|
||||
}
|
||||
|
||||
impl CliArgs {
|
||||
pub fn get() -> Self {
|
||||
Self::parse()
|
||||
}
|
||||
|
||||
pub fn preloaded(self) -> Config {
|
||||
Config {
|
||||
#[cfg(feature = "robocraft")]
|
||||
robocraft: crate::robocraft::RcConfig::from_args(&self),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Config {
|
||||
#[cfg(feature = "robocraft")]
|
||||
pub robocraft: crate::robocraft::RcConfig,
|
||||
}
|
||||
Reference in New Issue
Block a user