Add targets clippy
This commit is contained in:
parent
709a264c88
commit
487f6d05d2
45
src/clippy/target.hpp
Normal file
45
src/clippy/target.hpp
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <clippy/project_list.hpp>
|
||||||
|
|
||||||
|
#include <utils/editor.hpp>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
namespace clippy::targets {
|
||||||
|
class Target {
|
||||||
|
public:
|
||||||
|
virtual void Execute() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
class EmptyTarget : public Target {
|
||||||
|
public:
|
||||||
|
void Execute() override {}
|
||||||
|
};
|
||||||
|
|
||||||
|
class OpenProjectConfig : public Target {
|
||||||
|
public:
|
||||||
|
OpenProjectConfig(std::string config_path) : config_path_(config_path) {}
|
||||||
|
|
||||||
|
void Execute() override {
|
||||||
|
utils::OpenEditor(config_path_);
|
||||||
|
std::cout << "Open editor TODO" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::string config_path_;
|
||||||
|
};
|
||||||
|
|
||||||
|
class CreateProjectConfig : public Target {
|
||||||
|
public:
|
||||||
|
CreateProjectConfig(ProjectList& projects) : projects_(projects) {}
|
||||||
|
|
||||||
|
void Execute() override {
|
||||||
|
std::cout << "Make new project config and open editor TODO" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
ProjectList& projects_;
|
||||||
|
};
|
||||||
|
} // namespace clippy::targets
|
Loading…
Reference in a new issue