Standard completion of current option#5873
Standard completion of current option#5873schlessera merged 1 commit intowp-cli:mainfrom Roy-Orbison:patch-1
Conversation
|
@swissspidy What tests would you need for this change? You can verify it with the following commands: (COMP_LINE='wp search-replace --report'; wp cli completions --line="$COMP_LINE" --point=${#COMP_LINE})produces preserving the current word. Repeating the word, e.g. (COMP_LINE='wp search-replace --report --report'; wp cli completions --line="$COMP_LINE" --point=${#COMP_LINE})produces only which demonstrates that this change preserves the existing "don't complete options that have already been typed" behaviour. The |
|
|
|
We do have some tests in As for |
|
I updated the tests to accommodate the change to the repeated option behaviour, but I don't think there are any commands in this package with an option that's a prefix of another. A command package would have to be included during testing to perform that check. |
Make options complete in a manner more consistent with other shell programs. Closes #5845.
|
Thanks, @Roy-Orbison ! |
Make options complete in a manner more consistent with other shell programs.
Closes #5845.
This relies on
array_key_last()which may need to be polyfilled if it isn't already.