summaryrefslogtreecommitdiff
path: root/Source/Applications/Shell/Applets
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-12-26 12:34:27 +0100
committerAlexis211 <alexis211@gmail.com>2009-12-26 12:34:27 +0100
commitf2ccc0eaa3db7366787e2fa76ae52554e93b71f1 (patch)
treeec6f4ec10f5f710d8fd23ecef7e36967d89435ac /Source/Applications/Shell/Applets
parent6994f34953fac9462e899d0b2c7af64e21c92a1e (diff)
downloadMelon-f2ccc0eaa3db7366787e2fa76ae52554e93b71f1.tar.gz
Melon-f2ccc0eaa3db7366787e2fa76ae52554e93b71f1.zip
More work on the same stuff, all shell aplets are now external bins
Diffstat (limited to 'Source/Applications/Shell/Applets')
-rw-r--r--Source/Applications/Shell/Applets/mkdir.cpp17
-rw-r--r--Source/Applications/Shell/Applets/rm.cpp17
2 files changed, 34 insertions, 0 deletions
diff --git a/Source/Applications/Shell/Applets/mkdir.cpp b/Source/Applications/Shell/Applets/mkdir.cpp
new file mode 100644
index 0000000..56908d3
--- /dev/null
+++ b/Source/Applications/Shell/Applets/mkdir.cpp
@@ -0,0 +1,17 @@
+#include <App/ShellApp.proto.h>
+#include <Binding/FSNode.class.h>
+
+class mkdir : public ShellApp {
+ public:
+ mkdir() : ShellApp("mkdir", "Create a/some directory/ies") {}
+ int run() {
+ if (args.size() == 0) outvt << "Usage: mkdir <name> [<name> ...]\n";
+ for (u32int i = 0; i < args.size(); i++) {
+ if (!FS::mkdir(args[i], FS::cwdNode()).valid()) {
+ outvt << "Error while creating directory " << args[i] << "\n";
+ }
+ }
+ }
+};
+
+APP(mkdir);
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);