From cd6808e62cc653b1f02c4324e34a5f5735390fdd Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Sun, 4 Jun 2023 15:44:11 +0200 Subject: [PATCH] enable services via cli --- src/bin/Service.hx | 9 +++++++++ src/kernel/service/ServiceManager.hx | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/bin/Service.hx b/src/bin/Service.hx index 33ebc8b..2019c74 100644 --- a/src/bin/Service.hx +++ b/src/bin/Service.hx @@ -63,6 +63,15 @@ class Service extends CLIAppBase { return true; },"List all services"); + + registerSyncSubcommand("enable", (args) ->{ + if (args.length < 1) { + return false; + } + + ServiceManager.instance.enable(args[0]); + return true; + },"Enable a service"); } private function handleResult(res: Outcome): Bool { diff --git a/src/kernel/service/ServiceManager.hx b/src/kernel/service/ServiceManager.hx index 9f05544..2135547 100644 --- a/src/kernel/service/ServiceManager.hx +++ b/src/kernel/service/ServiceManager.hx @@ -19,7 +19,7 @@ class ServiceManager { /** Add a service to be automatically started. **/ - private function enable(name: String) { + public function enable(name: String) { if (!this.services.exists(name)){ return; // Service must be started }