Add not builtin command mkdir
This commit is contained in:
parent
0f2eb8413e
commit
6b7fe8d20a
|
@ -4,6 +4,8 @@ WIP
|
|||
|
||||
grsh - simple shell written in rust
|
||||
|
||||
Also some other tools (not builin in grsh)
|
||||
|
||||
## TODO
|
||||
|
||||
* add some builtins commands
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
use std::env;
|
||||
use std::fs;
|
||||
|
||||
fn main(){
|
||||
let args: Vec<String> = env::args().collect();
|
||||
for arg in 1..args.len() {
|
||||
match args[arg].as_str() {
|
||||
"--help" => {
|
||||
println!("Usage: mkdir [OPTIONS] DIRECTORY");
|
||||
return;
|
||||
}
|
||||
arg => {
|
||||
fs::create_dir_all(arg.to_string());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue