-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Descriptions and default values #5
Conversation
@mnapoli Thanks for looking into the defaults and descriptions, they'll be a big improvement. I do think that there should be a more fluid way to add them. Descriptions would almost always be necessary, so I think either defining them as a parameter in the With defaults, I think a chained method makes the most sense. Both descriptions and defaults are tied directly to the command so I think method chaining is the best methodology for both. I'd be happy to assist if need be. My time is sort of limited but I really like the style of this project, kind of like Slim for cli :-) |
@cwscribner so with the same example that would be: $app->command('greet firstname? lastname?', function () {
// ...
})->defaults([
'firstname' => 'John',
'lastname' => 'Doe',
])->descriptions('Greet someone', [
'name' => 'Who do you want to greet?',
'--yell' => 'If set, the task will yell in uppercase letters',
]); Is that what you had in mind? |
Precisely! I definitely like the |
OK that's fine by me, I'll try to update my PR when I have time (going on holidays soon ;)) |
Now uses fluent interface.
All done, @cwscribner syntax updated with the fluent interface. |
Descriptions and default values
This PR brings support to set descriptions and default values: