8000 Register the wrappers aliases differently to let them be autocomplete… · symfony-cli/symfony-cli@69dc212 · GitHub
[go: up one dir, main page]

Skip to content

Commit 69dc212

Browse files
committed
Register the wrappers aliases differently to let them be autocompleted right away
1 parent 61d44e0 commit 69dc212

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

commands/wrappers.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,30 @@ import (
2727

2828
var (
2929
composerWrapper = &console.Command{
30-
Name: "composer",
3130
Usage: "Runs Composer without memory limit",
3231
Hidden: console.Hide,
32+
// we use an alias to avoid the command being shown in the help but
33+
// still be available for completion
34+
Aliases: []*console.Alias{{Name: "composer"}},
3335
Action: func(c *console.Context) error {
3436
return console.IncorrectUsageError{ParentError: errors.New(`This command can only be run as "symfony composer"`)}
3537
},
3638
}
3739
binConsoleWrapper = &console.Command{
38-
Name: "console",
3940
Usage: "Runs the Symfony Console (bin/console) for current project",
4041
Hidden: console.Hide,
42+
// we use an alias to avoid the command being shown in the help but
43+
// still be available for completion
44+
Aliases: []*console.Alias{{Name: "console"}},
4145
Action: func(c *console.Context) error {
4246
return console.IncorrectUsageError{ParentError: errors.New(`This command can only be run as "symfony console"`)}
4347
},
4448
}
4549
phpWrapper = &console.Command{
4650
Usage: "Runs the named binary using the configured PHP version",
4751
Hidden: console.Hide,
52+
// we use aliases to avoid the command being shown in the help but
53+
// still be available for completion
4854
Aliases: func() []*console.Alias {
4955
binNames := php.GetBinaryNames()
5056
aliases := make([]*console.Alias, 0, len(binNames))

0 commit comments

Comments
 (0)
0