Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions features/prompt.feature
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,25 @@ Feature: Prompt user for input
"""
"Hello world!",hello-world,publish
"""

Scenario: Prompt should show positional arguments
Given a WP installation
And a value-file file:
"""
category
General
general



"""

When I run `wp term create --prompt < value-file`
Then STDOUT should contain:
"""
wp term create 'category' 'General' --slug='general'
"""
And STDOUT should contain:
"""
Created category
"""
11 changes: 10 additions & 1 deletion php/WP_CLI/Dispatcher/Subcommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,16 @@ public function invoke( $args, $assoc_args, $extra_args ) {
sprintf(
'wp %s %s',
$cmd,
ltrim( Utils\assoc_args_to_str( $actual_args ), ' ' )
ltrim(
implode(
' ',
[
ltrim( Utils\args_to_str( $args ), ' ' ),
ltrim( Utils\assoc_args_to_str( $actual_args ), ' ' ),
]
),
' '
)
)
);
}
Expand Down