laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.42k stars 10.99k forks source link

Parser::parse() problem in Artisan's arguments #14203

Closed daison12006013 closed 8 years ago

daison12006013 commented 8 years ago

I have this build https://travis-ci.org/laravel-libraries/modular/jobs/141726387 in which it throws `

Symfony\Component\Console\Exception\InvalidArgumentException: The "name" argument does not exist.

when you have this kind of signature

protected $signature = 'make:module {name: The module name}';

https://github.com/laravel-libraries/modular/blob/016dc98761e736a086ee52e2ed84f995f19a431c/src/Commands/Make/Module.php


The Parser::parse(..) function seems only understand space colon space " : " and it throws an error when using ": " or " :" not as flexible as I thought.

Here's the succesful build when using " : " https://travis-ci.org/laravel-libraries/modular/builds/141784435


TL;DR Concerns: The new way of inputting of arguments/options must be flexible, or atleast update the documentation, it almost leads me to apply override on getArguments() instead.

GrahamCampbell commented 8 years ago

Thanks for the report. If you need maximum flexibility, please just use the native methods inherited from symfony on the command class to define the command definition. Our signature property is just a shorthand to get the most common command definitions registered easily. It is not all inclusive.