mirror of
https://github.com/usatiuk/backup.git
synced 2025-10-27 01:37:49 +01:00
better commands
This commit is contained in:
@@ -14,14 +14,7 @@ public:
|
||||
virtual void run(Context ctx) = 0;
|
||||
|
||||
/// Default virtual destructor
|
||||
virtual ~Command() = 0;
|
||||
|
||||
/// The name of the command
|
||||
const std::string name;
|
||||
|
||||
protected:
|
||||
/// Constructs a command with name \p name
|
||||
Command(std::string name);
|
||||
virtual ~Command() = default;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ class CommandDiff : public Command {
|
||||
public:
|
||||
CommandDiff();
|
||||
void run(Context ctx) override;
|
||||
static constexpr std::string_view name{"diff"};
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ class CommandList : public Command {
|
||||
public:
|
||||
CommandList();
|
||||
void run(Context ctx) override;
|
||||
static constexpr std::string_view name{"list"};
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ class CommandListFiles : public Command {
|
||||
public:
|
||||
CommandListFiles();
|
||||
void run(Context ctx) override;
|
||||
static constexpr std::string_view name{"list-files"};
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ class CommandMount : public Command {
|
||||
public:
|
||||
CommandMount();
|
||||
void run(Context ctx) override;
|
||||
static constexpr std::string_view name{"mount"};
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ class CommandRestore : public Command {
|
||||
public:
|
||||
CommandRestore();
|
||||
void run(Context ctx) override;
|
||||
static constexpr std::string_view name{"restore"};
|
||||
|
||||
private:
|
||||
/// Internal function to restore a file
|
||||
|
||||
@@ -14,6 +14,7 @@ class CommandRun : public Command {
|
||||
public:
|
||||
CommandRun();
|
||||
void run(Context ctx) override;
|
||||
static constexpr std::string_view name{"run"};
|
||||
|
||||
private:
|
||||
/// Internal function to chunk the file and save it
|
||||
|
||||
Reference in New Issue
Block a user