Files
java-tutorials/libraries-3/src/main/java/com/baeldung/airline/LoggingCommand.java
T
mguarnaccia 0648ba53ab Bael 3460 (#8550)
* Hexagonal architecture: a quick and practical example

* BAEL 3486

* BAEL-3460

Airline introduction

* BAEL-3460

* BAEL-3460

Airline introduction
BAEL-3460

* BAEL-3460

* Formatting
2020-01-27 15:30:53 +00:00

25 lines
685 B
Java

package com.baeldung.airline;
import javax.inject.Inject;
import com.github.rvesse.airline.HelpOption;
import com.github.rvesse.airline.annotations.Command;
import com.github.rvesse.airline.annotations.Option;
@Command(name = "setup-log", description = "Setup our log")
public class LoggingCommand implements Runnable {
@Inject
private HelpOption<LoggingCommand> help;
@Option(name = { "-v", "--verbose" }, description = "Set log verbosity on/off")
private boolean verbose = false;
@Override
public void run() {
//skipping store user choice
if (!help.showHelpIfRequested())
System.out.println("Verbosity: " + verbose);
}
}