diff --git a/core/riot-core/src/main/java/com/redis/riot/core/AbstractCommand.java b/core/riot-core/src/main/java/com/redis/riot/core/AbstractCommand.java index d5268ac1c..a7fb3ab9f 100644 --- a/core/riot-core/src/main/java/com/redis/riot/core/AbstractCommand.java +++ b/core/riot-core/src/main/java/com/redis/riot/core/AbstractCommand.java @@ -11,10 +11,14 @@ import picocli.CommandLine.ArgGroup; import picocli.CommandLine.Command; +import picocli.CommandLine.Option; @Command public abstract class AbstractCommand extends BaseCommand implements InitializingBean, Callable { + @Option(names = "--help", usageHelp = true, description = "Show this help message and exit.") + private boolean helpRequested; + @ArgGroup(exclusive = false, heading = "Logging options%n") private LoggingArgs loggingArgs = new LoggingArgs(); diff --git a/core/riot-core/src/main/java/com/redis/riot/core/BaseCommand.java b/core/riot-core/src/main/java/com/redis/riot/core/BaseCommand.java index db20e2142..bc541d086 100644 --- a/core/riot-core/src/main/java/com/redis/riot/core/BaseCommand.java +++ b/core/riot-core/src/main/java/com/redis/riot/core/BaseCommand.java @@ -7,7 +7,7 @@ import picocli.CommandLine.Option; import picocli.CommandLine.Spec; -@Command(usageHelpAutoWidth = true, abbreviateSynopsis = true) +@Command(usageHelpAutoWidth = true, mixinStandardHelpOptions = true, abbreviateSynopsis = true) public abstract class BaseCommand { static { @@ -19,9 +19,6 @@ public abstract class BaseCommand { @Spec protected CommandSpec commandSpec; - @Option(names = "--help", usageHelp = true, description = "Show this help message and exit.") - private boolean helpRequested; - @Option(names = "-D", paramLabel = "", description = "Sets a System property.", mapFallbackValue = "", hidden = true) void setProperty(Map props) { props.forEach(System::setProperty); diff --git a/plugins/riot/src/main/java/com/redis/riot/Main.java b/plugins/riot/src/main/java/com/redis/riot/Main.java index 509e46e1c..383999a6c 100644 --- a/plugins/riot/src/main/java/com/redis/riot/Main.java +++ b/plugins/riot/src/main/java/com/redis/riot/Main.java @@ -5,9 +5,9 @@ import org.springframework.util.unit.DataSize; import com.redis.riot.core.BaseCommand; +import com.redis.riot.core.Expression; import com.redis.riot.core.IO; import com.redis.riot.core.PrintExceptionMessageHandler; -import com.redis.riot.core.Expression; import com.redis.riot.core.TemplateExpression; import com.redis.riot.operation.OperationCommand; import com.redis.spring.batch.Range;