pub fn assign_variables(shell: &mut Shell, string: &mut String) -> bool {
    lazy_static! {
        static ref RE: Regex = Regex::new(r"[a-zA-Z0-9_]+=.+").unwrap();
    }
    if RE.is_match(string) {
        let key_value: Vec<&str> = string.split("=").collect();
        shell.add_variable(key_value[0], Var::from(key_value[1]));
        return true;
    }
    false
}
///Only assigns variables if it is the first word in the command.
Only assigns variables if it is the first word in the command.
Only assigns variables if it is the first word in the command .
pub fn assign_variables(shell: &mut Shell, string: &mut String) -> bool {
    lazy_static! {
        static ref RE: Regex = Regex::new(r"[a-zA-Z0-9_]+=.+").unwrap();
    }
    if RE.is_match(string) {
        let key_value: Vec<&str> = string.split("=").collect();
        shell.add_variable(key_value[0], Var::from(key_value[1]));
        return true;
    }
    false
}
pub fn assign_variables ( shell : & mut Shell , string : & mut String ) -> bool { lazy_static ! { static ref RE Regex Regex new ( r"[a-zA-Z0-9_]+=.+" ) unwrap ( ) } if RE . is_match ( string ) { let key_value : Vec < & str > = string . split ( " " ) . collect ( ) ; shell . add_variable ( key_value [ 0 ] , Var :: from ( key_value [ 1 ] ) ) ; return true ; } false }
Only assigns variables if it is the first word in the command.
Only assigns variables if it is the first word in the command .
shell
&mut Shell
string
&mut String