@@ -23,24 +23,37 @@ fn print_completions<G: Generator>(gen: G, cmd: &mut clap::Command) {
23
23
generate ( gen, cmd, cmd. get_name ( ) . to_string ( ) , & mut std:: io:: stdout ( ) ) ;
24
24
}
25
25
26
+ const EMPTY : [ & str ; 0 ] = [ ] ;
27
+
26
28
#[ allow( clippy:: let_and_return) ]
27
29
fn cli ( ) -> clap:: Command {
28
30
clap:: Command :: new ( "exhaustive" )
29
- . version ( "3.0" )
30
- . propagate_version ( true )
31
31
. args ( [
32
- clap:: Arg :: new ( "global" )
33
- . long ( "global" )
34
- . global ( true )
35
- . action ( clap:: ArgAction :: SetTrue )
36
- . help ( "everywhere" ) ,
37
32
clap:: Arg :: new ( "generate" )
38
33
. long ( "generate" )
39
34
. value_name ( "SHELL" )
40
35
. value_parser ( clap:: value_parser!( Shell ) )
41
36
. help ( "generate" ) ,
37
+ clap:: Arg :: new ( "empty-choice" )
38
+ . long ( "empty-choice" )
39
+ . value_parser ( EMPTY ) ,
42
40
] )
43
41
. subcommands ( [
42
+ clap:: Command :: new ( "empty" )
43
+ . disable_help_subcommand ( true )
44
+ . disable_help_flag ( true ) ,
45
+ clap:: Command :: new ( "global" )
46
+ . version ( "3.0" )
47
+ . propagate_version ( true )
48
+ . args ( [ clap:: Arg :: new ( "global" )
49
+ . long ( "global" )
50
+ . global ( true )
51
+ . action ( clap:: ArgAction :: SetTrue )
52
+ . help ( "everywhere" ) ] )
53
+ . subcommands ( [
54
+ clap:: Command :: new ( "one" ) . subcommand ( clap:: Command :: new ( "one-one" ) ) ,
55
+ clap:: Command :: new ( "two" ) ,
56
+ ] ) ,
44
57
clap:: Command :: new ( "action" ) . args ( [
45
58
clap:: Arg :: new ( "set-true" )
46
59
. long ( "set-true" )
0 commit comments