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

Projects
None yet
3 participants
@jonsa
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
     +----+---+-------------+
     |    |   |             |
     |    |-+-|             |
     |----+-+-+             |
     |        |             |
     |        |             |
     |        |             |
     +--------+-------------+
@boedah

This comment has been minimized.

Show comment
Hide comment
@boedah

boedah Nov 2, 2014

Contributor

👍

Contributor

boedah commented Nov 2, 2014

👍

@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Nov 5, 2014

Member

Thanks!

Member

DavertMik commented Nov 5, 2014

Thanks!

DavertMik added a commit that referenced this pull request Nov 5, 2014

Merge pull request #71 from jonsa/feature-parse-phpdoc
Feature request: PHPdoc parser to populate command help

@DavertMik DavertMik merged commit b47a919 into consolidation:master Nov 5, 2014

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