Add an enum for output types

This commit is contained in:
AsamK 2021-01-16 18:52:06 +01:00
parent 14c8f07b8d
commit d4b4bd8603
6 changed files with 28 additions and 8 deletions

View file

@ -65,8 +65,8 @@ public class Cli {
parser.addArgument("-o", "--output")
.help("Choose to output in plain text or JSON")
.choices("plain-text", "json")
.setDefault("plain-text");
.type(Arguments.enumStringType(OutputType.class))
.setDefault(OutputType.PLAIN_TEXT);
Subparsers subparsers = parser.addSubparsers().title("subcommands").dest("command");