File tree Expand file tree Collapse file tree 5 files changed +26
-14
lines changed
src/main/java/com/dtsx/astra/cli/commands Expand file tree Collapse file tree 5 files changed +26
-14
lines changed Original file line number Diff line number Diff line change 22
33import com .dtsx .astra .cli .core .completions .impls .OutputTypeCompletion ;
44import com .dtsx .astra .cli .core .exceptions .internal .cli .OptionValidationException ;
5+ import com .dtsx .astra .cli .core .mixins .HelpMixin ;
56import com .dtsx .astra .cli .core .output .formats .OutputType ;
67import lombok .Getter ;
78import lombok .experimental .Accessors ;
1516import static com .dtsx .astra .cli .commands .AbstractCmd .SHOW_CUSTOM_DEFAULT ;
1617
1718@ Accessors (fluent = true )
18- public class CommonOptions {
19- @ Option (
20- names = { "-h" , "--help" },
21- description = "Show this help message and exit." ,
22- showDefaultValue = Visibility .NEVER ,
23- usageHelp = true ,
24- hidden = true
25- )
26- private boolean helpRequested ; // unfortunately mixins not allowed in arg groups :(
27-
19+ public class CommonOptions extends HelpMixin { // I don't like extending here but mixins don't compose w/ arg groups :(
2820 @ Getter
2921 private Optional <Ansi > ansi = Optional .empty ();
3022
Original file line number Diff line number Diff line change 11package com .dtsx .astra .cli .commands .config .home ;
22
3+ import com .dtsx .astra .cli .core .mixins .HelpMixin ;
34import picocli .CommandLine .Command ;
5+ import picocli .CommandLine .Mixin ;
46
57@ Command (
68 name = "home" ,
911 ConfigHomePathCmd .class ,
1012 }
1113)
12- public class ConfigHomeCmd {}
14+ public class ConfigHomeCmd {
15+ @ Mixin
16+ public HelpMixin help ;
17+ }
Original file line number Diff line number Diff line change 11package com .dtsx .astra .cli .commands .db .cqlsh ;
22
33import com .dtsx .astra .cli .core .help .Example ;
4+ import com .dtsx .astra .cli .core .mixins .HelpMixin ;
45import picocli .CommandLine .Command ;
6+ import picocli .CommandLine .Mixin ;
57
68@ Command (
79 name = "cqlsh" ,
2931 comment = "Execute a CQL file" ,
3032 command = "${cli.name} db cqlsh exec my_db -f script.cql"
3133)
32- public class CqlshCmd {}
34+ public class CqlshCmd {
35+ @ Mixin
36+ public HelpMixin help ;
37+ }
Original file line number Diff line number Diff line change 11package com .dtsx .astra .cli .commands .db .dsbulk ;
22
3+ import com .dtsx .astra .cli .core .mixins .HelpMixin ;
34import picocli .CommandLine .Command ;
5+ import picocli .CommandLine .Mixin ;
46
57@ Command (
68 name = "dsbulk" ,
1315 DbDsbulkPathCmd .class ,
1416 }
1517)
16- public class DbDsbulkCmd {}
18+ public class DbDsbulkCmd {
19+ @ Mixin
20+ public HelpMixin help ;
21+ }
Original file line number Diff line number Diff line change 11package com .dtsx .astra .cli .commands .streaming .pulsar ;
22
33import com .dtsx .astra .cli .core .help .Example ;
4+ import com .dtsx .astra .cli .core .mixins .HelpMixin ;
45import picocli .CommandLine .Command ;
6+ import picocli .CommandLine .Mixin ;
57
68@ Command (
79 name = "pulsar" ,
2426 comment = "Get pulsar executable path" ,
2527 command = "${cli.name} streaming pulsar path"
2628)
27- public class StreamingPulsarCmd {}
29+ public class StreamingPulsarCmd {
30+ @ Mixin
31+ public HelpMixin help ;
32+ }
You can’t perform that action at this time.
0 commit comments