make_vars #3

Merged
statzitz merged 3 commits from make_vars into main 2024-04-05 23:19:32 +02:00
Showing only changes of commit 0db8158795 - Show all commits

View file

@ -5,7 +5,6 @@ mod parser;
use std::env; use std::env;
fn main() { fn main() {
let args: Vec<String> = env::args().collect();
// def env variables. // def env variables.
let svdir_env = env::var("SVDIR"); let svdir_env = env::var("SVDIR");
@ -16,8 +15,6 @@ fn main() {
Err(..) => "/run/runit/service".to_string(), Err(..) => "/run/runit/service".to_string(),
}; };
// TODO: check if directory exists
let svwait_var = match svwait_env { let svwait_var = match svwait_env {
Ok(env) => match env.parse::<i32>() { Ok(env) => match env.parse::<i32>() {
Ok(var) => var, Ok(var) => var,
@ -30,11 +27,18 @@ fn main() {
dbg!(svwait_var); dbg!(svwait_var);
// args // run the parser
let args: Vec<String> = env::args().collect();
let arg_parser: Vec<String> = parser::parse_args(args); let arg_parser: Vec<String> = parser::parse_args(args);
dbg!(arg_parser); dbg!(arg_parser);
// TODO: Interpret the flags given if some are given.
// TODO: Set the command if it is given
// TODO: Exec the command on all given services.
//dbg!(args);
} }