Skip to content

Commit

Permalink
Add the --dump-and-exit option to exit after printing the full config…
Browse files Browse the repository at this point in the history
…uration.
  • Loading branch information
Anatoly Sablin committed Jan 27, 2020
1 parent 75efd99 commit aed12e5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/io/kamax/mxisd/MxisdStandaloneExec.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public static void main(String[] args) {
MxisdConfig cfg = null;
Iterator<String> argsIt = Arrays.asList(args).iterator();
boolean dump = false;
boolean exit = false;
while (argsIt.hasNext()) {
String arg = argsIt.next();
switch (arg) {
Expand All @@ -59,6 +60,7 @@ public static void main(String[] args) {
System.out.println(" -v Increase log level (log more info)");
System.out.println(" -vv Further increase log level");
System.out.println(" --dump Dump the full ma1sd configuration");
System.out.println(" --dump-and-exit Dump the full ma1sd configuration and exit");
System.out.println(" ");
System.exit(0);
return;
Expand All @@ -73,6 +75,8 @@ public static void main(String[] args) {
String cfgFile = argsIt.next();
cfg = YamlConfigLoader.loadFromFile(cfgFile);
break;
case "--dump-and-exit":
exit = true;
case "--dump":
dump = true;
break;
Expand All @@ -89,7 +93,9 @@ public static void main(String[] args) {

if (dump) {
YamlConfigLoader.dumpConfig(cfg);
System.exit(0);
if (exit) {
System.exit(0);
}
}

log.info("ma1sd starting");
Expand Down

0 comments on commit aed12e5

Please sign in to comment.