Massive reformating and cleanup
This commit is contained in:
@ -4,21 +4,20 @@
|
||||
|
||||
namespace fsh {
|
||||
|
||||
class CmdTouch : public Command {
|
||||
|
||||
protected:
|
||||
virtual void register_flags() override {
|
||||
ArgFactory& factory = get_factory();
|
||||
factory.add_rule<std::string>(true);
|
||||
}
|
||||
class CmdTouch : public Command {
|
||||
|
||||
virtual void run(std::istream& in, std::ostream& out, ArgManager& args) override {
|
||||
auto name = *(args.get<std::string>(0));
|
||||
if(std::ifstream(name, std::ios::in).good() || !std::ofstream(name, std::ios::out).is_open()) {
|
||||
throw std::runtime_error("File exists");
|
||||
protected:
|
||||
virtual void register_flags() override {
|
||||
ArgFactory& factory = get_factory();
|
||||
factory.add_rule<std::string>(true);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
virtual void run(std::istream& in, std::ostream& out, ArgManager& args) override {
|
||||
auto name = *(args.get<std::string>(0));
|
||||
if (std::ifstream(name, std::ios::in).good() || !std::ofstream(name, std::ios::out).is_open()) {
|
||||
throw std::runtime_error("File exists");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user