summaryrefslogblamecommitdiff
path: root/Source/Applications/Shell/Applets/rm.cpp
blob: 4dbb4ed1cfa30e622311669405b0cc2476c3cc90 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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);