mirror of
https://github.com/johndoe6345789/GithubWorkflowTool.git
synced 2026-04-26 14:45:03 +00:00
Initial implementation of GithubWorkflowTool
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
44
include/cli/CommandHandler.h
Normal file
44
include/cli/CommandHandler.h
Normal file
@@ -0,0 +1,44 @@
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QStringList>
|
||||
#include <memory>
|
||||
|
||||
namespace gwt {
|
||||
namespace core {
|
||||
class RepoManager;
|
||||
class JobExecutor;
|
||||
}
|
||||
|
||||
namespace cli {
|
||||
|
||||
/**
|
||||
* @brief Handles command-line interface commands
|
||||
*/
|
||||
class CommandHandler : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit CommandHandler(QObject* parent = nullptr);
|
||||
~CommandHandler() override;
|
||||
|
||||
/**
|
||||
* @brief Execute a command with arguments
|
||||
* @param args Command line arguments
|
||||
* @return Exit code
|
||||
*/
|
||||
int execute(const QStringList& args);
|
||||
|
||||
private:
|
||||
std::unique_ptr<core::RepoManager> m_repoManager;
|
||||
std::unique_ptr<core::JobExecutor> m_executor;
|
||||
|
||||
void printHelp() const;
|
||||
int handleClone(const QStringList& args);
|
||||
int handleList(const QStringList& args);
|
||||
int handleRun(const QStringList& args);
|
||||
int handleWorkflows(const QStringList& args);
|
||||
};
|
||||
|
||||
} // namespace cli
|
||||
} // namespace gwt
|
||||
Reference in New Issue
Block a user