Re:Creating a bash completion script (2018)
by theluketowers on Wednesday March 02, 2022 @03:41AM
(#30525219)
Symfony 5.4 just added support for bash completion to PHP CLI commands using the library so we were able to add a very nice and easy to use interface to Winter CMS to take advantage of it: https://wintercms.com/blog/post/console-improvements-winter-...
Defining completion values for a given argument in a Winter CMS CLI command is as easy as adding a single method to the command's class now:
public function suggestMyArgumentValues(string $currentValue, array $allInput): array
{
return ['array', 'of', 'suggested', 'values'];
}
Defining completion values for a given argument in a Winter CMS CLI command is as easy as adding a single method to the command's class now: