-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console][Completion] allow "signaling" from the completion command to the completion script #43608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thank you for this suggestion. |
Just a quick reminder to make a comment on this. If I don't hear anything I'll close this. |
Yes. |
The logic for file path completion have been implemented in Castor: https://github.com/jolicode/castor/blob/ac7fa928eb2ebc093fe2eaacec275ef1c3174b1f/src/Console/Command/TaskCommand.php#L254 |
@GromNaN isn't this something that should use the shell features instead of implementing in PHP? Basically, the completion script should use the correct already existing shell completion, no? |
I totally agree, it's a basic shell feature that can even have specific improvements. But Castor's approach works until we figure out how to do it better. |
Uh oh!
There was an error while loading. Please reload this page.
Description
Assuming #43607 is implemented (which implies a single signal,
null
), native filesystem is used as a fallback when Symfony doesn't have any completion to do (and doesn't explicitly say there's no matching values, the mentionednull
signal).Some values completed by native methods could get additional processing, for example the value could only be allowed to be a file path (not a directory), or matching a specific glob like
*.twig
(see #43594 (comment)).Idea is to allow sending "signals" from the completion command to the completion script, which can then use those signals to do something special, not just dump the suggested values.
Example
1.
compgen
gets invoked in a special way, not just the default, see https://www.linuxjournal.com/content/more-using-bash-complete-commandSee #43594 (comment) for an outline of the workflow.
Note
If implemented, this feature must do a version check of the completion script. The version of the completion script is passed as a param to the completion command. This means these signals cannot be offered if the completion script was generated prior to the feature because it will offer the signals verbatim as suggestions to the end user.
The text was updated successfully, but these errors were encountered: