Created
February 9, 2020 17:28
-
-
Save tobidope/7db9e94e43922a6f540fb22796f24c24 to your computer and use it in GitHub Desktop.
Nun
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package test.picocli; | |
| import io.micronaut.configuration.picocli.PicocliRunner; | |
| import io.micronaut.context.ApplicationContext; | |
| import picocli.CommandLine; | |
| import picocli.CommandLine.Command; | |
| import picocli.CommandLine.Option; | |
| import picocli.CommandLine.Parameters; | |
| @Command(name = "test-picocli", description = "...", | |
| mixinStandardHelpOptions = true) | |
| public class TestPicocliCommand implements Runnable { | |
| @Option(names = {"-v", "--verbose"}, description = "...") | |
| boolean verbose; | |
| public static void main(String[] args) throws Exception { | |
| PicocliRunner.run(TestPicocliCommand.class, args); | |
| } | |
| public void run() { | |
| // business logic here | |
| if (verbose) { | |
| System.out.println("Hi!"); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment