Skip to content
Snippets Groups Projects
Commit 1e6cd4d4 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Add unlink

parent 92cd8597
No related branches found
No related tags found
No related merge requests found
...@@ -194,6 +194,19 @@ impl<'a> Command<'a> { ...@@ -194,6 +194,19 @@ impl<'a> Command<'a> {
main: Box::new(|_: &Vec<String>| {}), main: Box::new(|_: &Vec<String>| {}),
}); });
commands.push(Command {
name: "rm",
help: "To remove a file, in the current directory\n rm <my_file>",
main: Box::new(|args: &Vec<String>| {
match args.get(1) {
Some(file_name) => if ! unlink(file_name) {
println!("Failed to remove: {}", file_name);
},
None => println!("No name provided")
}
}),
});
commands.push(Command { commands.push(Command {
name: "run", name: "run",
help: "Reads and runs a script file\n run <my_script>", help: "Reads and runs a script file\n run <my_script>",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment