Skip to content
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

Use `shortdesc`, `synopsis`, and `when` with `::add_subcommand()` #2389

Merged
merged 2 commits into from Jan 19, 2016

Conversation

@danielbachhuber
Copy link
Member

commented Jan 18, 2016

Permits registration of these command attributes through variable,
instead of PHPDoc. For instance:

WP_CLI::add_command( 'foo', 'foo', array(
  'shortdesc'   => 'My awesome function command',
  'when'        => 'before_wp_load',
  'synopsis'    => array(
    array(
      'type'          => 'positional',
      'name'          => 'message',
      'description'   => 'An awesome message to display',
      'optional'      => false,
    ),
    array(
      'type'          => 'assoc',
      'name'          => 'apple',
      'description'   => 'A type of fruit.',
      'optional'      => false,
    ),
    array(
      'type'          => 'assoc',
      'name'          => 'meal',
      'description'   => 'A type of meal.',
      'optional'      => true,
    ),
  ),
) );

See #2374

Use `shortdesc`, `synopsis`, and `when` with `::add_subcommand()`
Permits registration of these command attributes through variable,
instead of PHPDoc

@danielbachhuber danielbachhuber added this to the 0.23.0 milestone Jan 18, 2016

@danielbachhuber

This comment has been minimized.

Copy link
Member Author

commented Jan 18, 2016

Still need to:

  • Write tests for SynopsisParserTest

@danielbachhuber danielbachhuber self-assigned this Jan 18, 2016

danielbachhuber added a commit that referenced this pull request Jan 19, 2016
Merge pull request #2389 from wp-cli/2374-register-desc-synopsis
Use `shortdesc`, `synopsis`, and `when` with `::add_subcommand()`

@danielbachhuber danielbachhuber merged commit 65e5b82 into master Jan 19, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@danielbachhuber danielbachhuber deleted the 2374-register-desc-synopsis branch Jan 19, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.