changed synaopsis to srv

This commit is contained in:
Djeeberjr 2023-06-25 19:02:45 +02:00
parent 9d6979c8e8
commit 7996dd062d

View File

@ -16,7 +16,7 @@ class Service extends CLIAppBase {
var result = ServiceManager.instance.start(name); var result = ServiceManager.instance.start(name);
return handleResult(result); return handleResult(result);
},"Start a service"); },"<name>");
registerSyncSubcommand("stop", (args) ->{ registerSyncSubcommand("stop", (args) ->{
if (args.length < 1) { if (args.length < 1) {
@ -27,7 +27,7 @@ class Service extends CLIAppBase {
var result = ServiceManager.instance.stop(name); var result = ServiceManager.instance.stop(name);
return handleResult(result); return handleResult(result);
},"Stop a service"); },"<name>");
registerSyncSubcommand("register", (args) ->{ registerSyncSubcommand("register", (args) ->{
if (args.length < 2) { if (args.length < 2) {
@ -40,7 +40,7 @@ class Service extends CLIAppBase {
var result = ServiceManager.instance.register(name, binName, rest); var result = ServiceManager.instance.register(name, binName, rest);
return handleResult(result); return handleResult(result);
},"Register a new service"); },"<name> <binary> <args...>");
registerSyncSubcommand("unregister", (args) ->{ registerSyncSubcommand("unregister", (args) ->{
if (args.length < 2) { if (args.length < 2) {
@ -51,7 +51,7 @@ class Service extends CLIAppBase {
var result = ServiceManager.instance.unregister(name); var result = ServiceManager.instance.unregister(name);
return handleResult(result); return handleResult(result);
},"Unregister a service"); },"<name>");
registerSyncSubcommand("list", (args) ->{ registerSyncSubcommand("list", (args) ->{
@ -62,7 +62,7 @@ class Service extends CLIAppBase {
} }
return true; return true;
},"List all services"); });
registerSyncSubcommand("enable", (args) ->{ registerSyncSubcommand("enable", (args) ->{
if (args.length < 1) { if (args.length < 1) {
@ -71,7 +71,7 @@ class Service extends CLIAppBase {
ServiceManager.instance.enable(args[0]); ServiceManager.instance.enable(args[0]);
return true; return true;
},"Enable a service"); },"<name>");
} }
private function handleResult(res: Outcome<Noise,String>): Bool { private function handleResult(res: Outcome<Noise,String>): Bool {