BIG FORMATING COMMIT

This commit is contained in:
2023-07-30 15:55:22 +02:00
parent 088fce0aaa
commit 91972107eb
103 changed files with 1610 additions and 1585 deletions

View File

@@ -4,64 +4,64 @@ import kernel.KernelSettings;
import lib.CLIAppBase;
class KSettings extends CLIAppBase {
public function new() {
registerSyncSubcommand("get", (args)->{
var key = args[0];
public function new() {
registerSyncSubcommand("get", (args) -> {
var key = args[0];
if (key == null) {
handle.writeLine("Key not specified");
return false;
}
if (key == null) {
handle.writeLine("Key not specified");
return false;
}
var value = switch (key){
case "hostname":
KernelSettings.hostname;
case "sitecontroller":
Std.string(KernelSettings.siteController);
default:
null;
}
var value = switch (key) {
case "hostname":
KernelSettings.hostname;
case "sitecontroller":
Std.string(KernelSettings.siteController);
default:
null;
}
if (value == null) {
handle.writeLine("Key not found or not set");
return false;
}
if (value == null) {
handle.writeLine("Key not found or not set");
return false;
}
handle.writeLine(value);
return true;
}," <key>");
handle.writeLine(value);
return true;
}, " <key>");
registerSyncSubcommand("set", (args)->{
var key = args[0];
registerSyncSubcommand("set", (args) -> {
var key = args[0];
if (key == null) {
handle.writeLine("Key not specified");
return false;
}
if (key == null) {
handle.writeLine("Key not specified");
return false;
}
var value = args[1];
var value = args[1];
if (value == null) {
handle.writeLine("Value not specified");
return false;
}
if (value == null) {
handle.writeLine("Value not specified");
return false;
}
switch (key){
case "hostname":
KernelSettings.hostname = value;
case "sitecontroller":
KernelSettings.siteController = Std.parseInt(value);
default:
handle.writeLine("Key not found");
return false;
}
return true;
}," <key> <value>");
switch (key) {
case "hostname":
KernelSettings.hostname = value;
case "sitecontroller":
KernelSettings.siteController = Std.parseInt(value);
default:
handle.writeLine("Key not found");
return false;
}
return true;
}, " <key> <value>");
registerSyncSubcommand("list", (args)->{
handle.writeLine("hostname");
handle.writeLine("sitecontroller");
return true;
});
}
}
registerSyncSubcommand("list", (args) -> {
handle.writeLine("hostname");
handle.writeLine("sitecontroller");
return true;
});
}
}