Details
-
Type:
Improvement
-
Status: Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: 2.0 M1
-
Component/s: None
-
Labels:None
Description
It would be useful if you could specify CLI options on a parameter object of the CLI command.
Currently all options need to be parameters of the command method. This becomes unwieldy if you have a lot of options.
Imagine something like this:
@CliCommand(value = "ping-server", help = "Send ICMP ECHO_REQUEST to network hosts") public void ping(@CliOptions PingOptions pingOptions) { ... } public class PingOptions { @CliOption(key = "a", mandatory = false, help = "Audible ping", unspecifiedDefaultValue = "false", specifiedDefaultValue = "true") private boolean audiblePing; @CliOption(key = "i", mandatory = false, help = "Wait interval seconds between sending each packet.", unspecifiedDefaultValue = "1", specifiedDefaultValue = "1") private int interval; ... }