Refact0r
Some checks failed
Dropshell Test / Build_and_Test (push) Has been cancelled

This commit is contained in:
Your Name
2025-05-17 19:40:51 +12:00
parent 203068048d
commit 1d3bb634f0
17 changed files with 608 additions and 499 deletions

View File

@ -4,6 +4,8 @@
#include "templates.hpp"
#include "utils/assert.hpp"
#include "utils/utils.hpp"
#include "services.hpp"
namespace dropshell
{
@ -19,7 +21,7 @@ namespace dropshell
{
CommandRegistry::instance().register_command({uninstall_name_list,
uninstall_handler,
std_autocomplete_allowall,
shared_commands::std_autocomplete_allowall,
false, // hidden
true, // requires_config
true, // requires_install
@ -39,7 +41,7 @@ namespace dropshell
bool uninstall_service(const std::string &server, const std::string &service, bool silent)
bool uninstall_service(const std::string &server, const std::string &service, bool silent=false)
{
if (!silent)
maketitle("Uninstalling " + service + " on " + server);
@ -97,14 +99,14 @@ namespace dropshell
std::vector<LocalServiceInfo> services = get_server_services_info(server);
for (const auto &service : services)
{
if (!uninstall_service(server, service.service_name, false))
if (!uninstall_service(server, service.service_name))
okay = false;
}
return okay ? 0 : 1;
}
std::string service = safearg(ctx.args, 1);
return uninstall_service(server, service, false) ? 0 : 1;
return uninstall_service(server, service) ? 0 : 1;
}