Add missing required arguments when using --prompt#5865
Merged
swissspidy merged 1 commit intowp-cli:mainfrom Nov 10, 2023
Merged
Add missing required arguments when using --prompt#5865swissspidy merged 1 commit intowp-cli:mainfrom
--prompt#5865swissspidy merged 1 commit intowp-cli:mainfrom
Conversation
7d10ddc to
5645c05
Compare
swissspidy
reviewed
Nov 10, 2023
php/WP_CLI/Dispatcher/Subcommand.php
Outdated
| 'wp %s %s', | ||
| $cmd, | ||
| ltrim( Utils\assoc_args_to_str( $actual_args ), ' ' ) | ||
| ltrim( implode( ' ', [ Utils\args_to_str( $args ), Utils\assoc_args_to_str( $actual_args ) ] ), ' ' ) |
Member
There was a problem hiding this comment.
Suggested change
| ltrim( implode( ' ', [ Utils\args_to_str( $args ), Utils\assoc_args_to_str( $actual_args ) ] ), ' ' ) | |
| ltrim( implode( '', [ Utils\args_to_str( $args ), Utils\assoc_args_to_str( $actual_args ) ] ), ' ' ) |
This might fix the double space issue. assoc_args_to_str() will have a leading space, so no need to add another.
Contributor
Author
There was a problem hiding this comment.
I came up with a solution - forgot to push it before lunch 🙈 - I hope this works now and passes all the tests.
5645c05 to
c42c372
Compare
Member
|
@2ndkauboy Looks like it needs a PHPCS fix |
c42c372 to
b1f71e0
Compare
Contributor
Author
|
@danielbachhuber you are right. It's fixed now. |
When using the `--prompt` argument on a command, the executed command gets logged, showing the command and arguments the prompt had collected. This logged command, however, lacks all required `$args` and only lists the `$assoc_args` (that are not empty). This patch will add the required arguments as well.
b1f71e0 to
438cdbc
Compare
swissspidy
approved these changes
Nov 10, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using the
--promptargument on a command, the executed command gets logged, showing the command and arguments the prompt had collected.This logged command, however, lacks all required
$argsand only lists the$assoc_args(that are not empty).This patch will add the required arguments as well.
Fixes #5768
Related: #5859