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

Feature request: PHPdoc parser to populate command help #71

Merged
merged 2 commits into from Nov 5, 2014

Conversation

@jonsa
Copy link
Contributor

jonsa commented Nov 2, 2014

I've implemented the feature request I named in #64 where the phpdoc-block was parsed for information to populate descriptions for arguments and options. It also improves the command description parsing by putting all but the first line in the help section.

In other words, it turns

/**
 * Calculate the fibonacci sequence between two numbers.
 *
 * Graphic output will look like
 *     +----+---+-------------+
 *     |    |   |             |
 *     |    |-+-|             |
 *     |----+-+-+             |
 *     |        |             |
 *     |        |             |
 *     |        |             |
 *     +--------+-------------+
 *
 * @param int $start Number to start from
 * @param $steps int Number of steps to perform
 * @param array $opts
 * @option $graphic Display the sequence graphically using cube
 *                  representation
 */
public function fibonacci($start, $steps, $opts = ['graphic' => false])
{
}

into

$ ./robo fibonacci --help
Usage:
 fibonacci [--graphic] start steps

Arguments:
 start                 Number to start from
 steps                 Number of steps to perform

Options:
 --graphic             Display the sequence graphically using cube representation

Help:
 Graphic output will look like
     +----+---+-------------+
     |    |   |             |
     |    |-+-|             |
     |----+-+-+             |
     |        |             |
     |        |             |
     |        |             |
     +--------+-------------+
…guments and options
@boedah
Copy link
Contributor

boedah commented Nov 2, 2014

👍

@DavertMik
Copy link
Member

DavertMik commented Nov 5, 2014

Thanks!

DavertMik added a commit that referenced this pull request Nov 5, 2014
Feature request: PHPdoc parser to populate command help
@DavertMik DavertMik merged commit b47a919 into consolidation:master Nov 5, 2014
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.