File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,20 @@ const COMPRESSED_MAN: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/man.tgz"
15
15
pub fn cli ( ) -> Command {
16
16
subcommand ( "help" )
17
17
. about ( "Displays help for a cargo subcommand" )
18
- . arg ( Arg :: new ( "COMMAND" ) . action ( ArgAction :: Set ) )
18
+ . arg ( Arg :: new ( "COMMAND" ) . action ( ArgAction :: Set ) . add (
19
+ clap_complete:: ArgValueCandidates :: new ( || {
20
+ // TODO: Need a faster way to get all subcommand names.
21
+ super :: builtin ( )
22
+ . iter ( )
23
+ . map ( |cmd| {
24
+ let name = cmd. get_name ( ) ;
25
+ clap_complete:: CompletionCandidate :: new ( name)
26
+ . help ( cmd. get_about ( ) . cloned ( ) )
27
+ . hide ( cmd. is_hide_set ( ) )
28
+ } )
29
+ . collect ( )
30
+ } ) ,
31
+ ) )
19
32
}
20
33
21
34
pub fn exec ( gctx : & mut GlobalContext , args : & ArgMatches ) -> CliResult {
You can’t perform that action at this time.
0 commit comments