46 lines
882 B
C++
46 lines
882 B
C++
![]() |
#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
|