silly icon indicating copy to clipboard operation
silly copied to clipboard

single command applications with arguments

Open glensc opened this issue 8 years ago • 4 comments

while single command applications are possible with setDefaultCommand:

$app->command('run', /* ... */);
$app->setDefaultCommand('run');

http://mnapoli.fr/silly/docs/command-definition.html

implemented (suggested) via: #30

it doesn't play well when you want to use arguments (not options), as that would require that you specify command name before first argument.

glensc avatar Sep 09 '17 03:09 glensc

done some research,

seems it's possible to solve this, but seems the secotnd argument to setDefaultCommand requires symfony/console 3.2

for older versions it's possible too, but a bit more complex.

neither of these is documented in http://mnapoli.fr/silly/docs/command-definition.html and doesn't mention problem with non-option arguments

glensc avatar Sep 09 '17 13:09 glensc

Good point. I'd like to avoid the workaround for Symfony < 3.2 though. And upgrading to 3.2 is maybe a bit early?

mnapoli avatar Sep 14 '17 11:09 mnapoli

i think documenting and proposing application to use 3.2 is sufficient. this library shouldn't require newer symfony (that is not base functionality). and pointing to documentation how to use in older version.

yeah probably just putting my comment into docs: https://github.com/mnapoli/silly/issues/41#issuecomment-328277595

glensc avatar Sep 14 '17 15:09 glensc

:+1: then feel free to send a pull request to add that to the docs that would be perfect!

mnapoli avatar Sep 14 '17 20:09 mnapoli