Added Include folder
*facepalm*
This commit is contained in:
26
include/cmd/cmd_rm.hpp
Normal file
26
include/cmd/cmd_rm.hpp
Normal file
@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include "cmd/cmd_base.hpp"
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
|
||||
namespace fsh {
|
||||
|
||||
class CmdRM : public Command {
|
||||
|
||||
protected:
|
||||
virtual void register_flags() override {
|
||||
ArgFactory& factory = get_factory();
|
||||
factory.add_rule<std::string>(1);
|
||||
}
|
||||
|
||||
virtual void run(std::istream& in, std::ostream& out, ArgManager& args) override {
|
||||
|
||||
if(std::remove(args.get<std::string>(0).value().c_str())) {
|
||||
throw std::runtime_error("Could not delete file");
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user