summaryrefslogtreecommitdiff
path: root/Source/Applications/Shell/Applets/rm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Applications/Shell/Applets/rm.cpp')
-rw-r--r--Source/Applications/Shell/Applets/rm.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/Applications/Shell/Applets/rm.cpp b/Source/Applications/Shell/Applets/rm.cpp
new file mode 100644
index 0000000..4dbb4ed
--- /dev/null
+++ b/Source/Applications/Shell/Applets/rm.cpp
@@ -0,0 +1,17 @@
+#include <App/ShellApp.proto.h>
+#include <Binding/FSNode.class.h>
+
+class rm : public ShellApp {
+ public:
+ rm() : ShellApp("rm", "Remove a/some file(s)/directorie(s)") {}
+ int run() {
+ if (args.size() == 0) outvt << "Usage : rm <file> [<file> ...]\n";
+ for (u32int i = 0; i < args.size(); i++) {
+ if (!FS::find(args[i], FS::cwdNode()).remove()) {
+ outvt << "Error while removing file " << args[i] << "\n";
+ }
+ }
+ }
+};
+
+APP(rm);