generated from OBJNULL/Dockerized-Rust
Added config
This commit is contained in:
parent
891a608f6f
commit
d7075bce86
1 changed files with 21 additions and 0 deletions
21
project/src/config.rs
Normal file
21
project/src/config.rs
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
// Libraries
|
||||||
|
use std::env;
|
||||||
|
|
||||||
|
// Enums
|
||||||
|
pub enum OperationMode {
|
||||||
|
Training,
|
||||||
|
Infrence,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
pub fn get_operation_mode() -> Option<OperationMode> {
|
||||||
|
// Getting command line arguments
|
||||||
|
let args: Vec<String> = env::args().collect();
|
||||||
|
|
||||||
|
// Getting operation mode
|
||||||
|
match &args[1] {
|
||||||
|
"training" => Some(OperationMode::Training),
|
||||||
|
"infrence" => Some(OperationMode::Infrence),
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue