Skip to content

Commit 155003b

Browse files
committed
Add --license arg to package-readme command
Follow-up to #276 and 72fd665
1 parent 72fd665 commit 155003b

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ WP-CLI Behat framework uses Behat ~2.5, which is installed with Composer.
194194
Generate a README.md for your command.
195195

196196
~~~
197-
wp scaffold package-readme <dir> [--force] [--branch=<branch>]
197+
wp scaffold package-readme <dir> [--force] [--branch=<branch>] [--license=<license>]
198198
~~~
199199

200200
Creates a README.md with Using, Installing, and Contributing instructions
@@ -279,6 +279,12 @@ In this example:
279279
[--branch=<branch>]
280280
Name of default branch of the underlying repository. Defaults to main.
281281

282+
[--license=<license>]
283+
License for the package.
284+
---
285+
default: MIT
286+
---
287+
282288

283289

284290
### wp scaffold package-github

src/ScaffoldPackageCommand.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,12 @@ public function package( $args, $assoc_args ) {
250250
* [--branch=<branch>]
251251
* : Name of default branch of the underlying repository. Defaults to main.
252252
*
253+
* [--license=<license>]
254+
* : License for the package.
255+
* ---
256+
* default: MIT
257+
* ---
258+
*
253259
* @when before_wp_load
254260
* @subcommand package-readme
255261
*/
@@ -285,6 +291,7 @@ public function package_readme( $args, $assoc_args ) {
285291
'has_commands' => false,
286292
'wp_cli_update_to_instructions' => 'the latest stable release with `wp cli update`',
287293
'show_powered_by' => isset( $composer_obj['extra']['readme']['show_powered_by'] ) ? (bool) $composer_obj['extra']['readme']['show_powered_by'] : true,
294+
'license' => $assoc_args['license'],
288295
];
289296

290297
if ( isset( $composer_obj['extra']['readme']['shields'] ) ) {

0 commit comments

Comments
 (0)