From 72df2342900a485fc6f41453143ac489b26091a8 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 11 May 2025 13:40:40 +1200 Subject: [PATCH] . --- src/commands/install.cpp | 129 +++++++++++++++++++++++++++++++++++++++ src/service_runner.hpp | 11 +--- 2 files changed, 130 insertions(+), 10 deletions(-) create mode 100644 src/commands/install.cpp diff --git a/src/commands/install.cpp b/src/commands/install.cpp new file mode 100644 index 0000000..0fb1684 --- /dev/null +++ b/src/commands/install.cpp @@ -0,0 +1,129 @@ +#include "command_registry.hpp" +#include "config.hpp" +#include "utils/utils.hpp" +#include "service_runner.hpp" +#include "utils/directories.hpp" +#include "standard_autocomplete.hpp" +#include "templates.hpp" +#include +#include +#include +#include +#include +#include + +namespace dropshell { + +void install_autocomplete(const CommandContext& ctx); +int install_handler(const CommandContext& ctx); + +static std::vector install_name_list={"install"}; + +// Static registration +struct InstallCommandRegister { + InstallCommandRegister() { + CommandRegistry::instance().register_command({ + install_name_list, + install_handler, + install_autocomplete, + false, // hidden + false, // requires_config + 2, // min_args (after command) + 2, // max_args (after command) + "install SERVER SERVICE", + "Install/reinstall/update service(s). Safe/non-destructive.", + // heredoc + R"( + Install a service on a server. + install install the given service on the given server. + + Note you need to create the service first with: + dropshell create-service