Closed gou1 closed 7 years ago
Hello there!
Silly is great for quick and clean CLI apps ! So is SymfonyStyle (http://symfony.com/blog/new-in-symfony-2-8-console-style-guide) for quickly handling i/o. Right now, using it is a bit verbose:
$app->command('meh', function(InputInterface $input, OutputInterface $output){ $io = new SymfonyStyle($input, $output); $io->comment('Aye aye, sir'); });
In an ideal world, i'd like to be able to:
$app->command('yeah', function (SymfonyStyle $io) { $io->comment('Aye aye, sir'); });
I tried to use DI for this, but it seems I cannot inject Request/Response in my service. Something like:
$pimple[SymfonyStyle::class] = function ($pimple) { return new SymfonyStyle($pimple['input'], $pimple['output']); };
or like:
$pimple[SymfonyStyle::class] = function (InputInterface $input, OutputInterface $output) { return new SymfonyStyle($input, $output); };
Eventually:
Thanks a lot!
Hi @gou1, that's a great idea! I've opened #38 to add that.
You rock dude 💯
Hello there!
Silly is great for quick and clean CLI apps ! So is SymfonyStyle (http://symfony.com/blog/new-in-symfony-2-8-console-style-guide) for quickly handling i/o. Right now, using it is a bit verbose:
In an ideal world, i'd like to be able to:
I tried to use DI for this, but it seems I cannot inject Request/Response in my service. Something like:
or like:
Eventually:
Thanks a lot!