File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 3
3
namespace Stecman \Component \Symfony \Console \BashCompletion ;
4
4
5
5
use Stecman \Component \Symfony \Console \BashCompletion \CompletionCommand ;
6
+ use Stecman \Component \Symfony \Console \BashCompletion \Completion ;
6
7
7
8
class ComposerCompletionCommand extends CompletionCommand
8
9
{
@@ -25,6 +26,25 @@ protected function runCompletion()
25
26
);
26
27
}
27
28
29
+ // Complete for `help` command's `command` argument
30
+ $ application = $ this ->getApplication ();
31
+ $ this ->handler ->addHandler (
32
+ new Completion (
33
+ 'help ' ,
34
+ 'command_name ' ,
35
+ Completion::TYPE_ARGUMENT ,
36
+ function () use ($ application ) {
37
+ $ names = array_keys ($ application ->all ());
38
+
39
+ if ($ key = array_search ('_completion ' , $ names )) {
40
+ unset($ names [$ key ]);
41
+ }
42
+
43
+ return $ names ;
44
+ }
45
+ )
46
+ );
47
+
28
48
return $ this ->handler ->runCompletion ();
29
49
}
30
50
}
You can’t perform that action at this time.
0 commit comments