pub struct Command { command: String, sub_command: String, option: Vec<String>, path: String, index: usize, pipe: Option<Box<CommandParse>>, redirect: Option<Redirect>, } fn judge_loop(&mut self, mut line_split: &mut Vec<&str>) { self.index += 1; let line_index = line_split.len(); //配列の先頭は実行するコマンド self.command = line_split[0].to_string(); loop { if line_index <= self.index { break; } self.judge(&m
![Rustで作った自作Shellの話](https://cdn-ak-scissors.b.st-hatena.com/image/square/84182e01c5d446bfb509ac1905e1b74cbe1314cf/height=288;version=1;width=512/https%3A%2F%2Fres.cloudinary.com%2Fzenn%2Fimage%2Fupload%2Fs--WhaG65Gd--%2Fc_fit%252Cg_north_west%252Cl_text%3Anotosansjp-medium.otf_55%3ARust%2525E3%252581%2525A7%2525E4%2525BD%25259C%2525E3%252581%2525A3%2525E3%252581%25259F%2525E8%252587%2525AA%2525E4%2525BD%25259CShell%2525E3%252581%2525AE%2525E8%2525A9%2525B1%252Cw_1010%252Cx_90%252Cy_100%2Fg_south_west%252Cl_text%3Anotosansjp-medium.otf_37%3A%2525E3%252582%2525AC%2525E3%252583%2525AC%2525E3%252583%252590%2525E3%252583%2525AC%252Cx_203%252Cy_121%2Fg_south_west%252Ch_90%252Cl_fetch%3AaHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL3plbm4tdXNlci11cGxvYWQvYXZhdGFyLzY3ZWYwOTllZjMuanBlZw%3D%3D%252Cr_max%252Cw_90%252Cx_87%252Cy_95%2Fv1627283836%2Fdefault%2Fog-base-w1200-v2.png)