diff options
author | Alexis211 <alexis211@gmail.com> | 2009-12-26 12:34:27 +0100 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-12-26 12:34:27 +0100 |
commit | f2ccc0eaa3db7366787e2fa76ae52554e93b71f1 (patch) | |
tree | ec6f4ec10f5f710d8fd23ecef7e36967d89435ac /Source/Applications/Shell/Applets | |
parent | 6994f34953fac9462e899d0b2c7af64e21c92a1e (diff) | |
download | Melon-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.cpp | 17 | ||||
-rw-r--r-- | Source/Applications/Shell/Applets/rm.cpp | 17 |
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); |