Skip to content

Commit e176065

Browse files
committed
Allow default command
1 parent 2cfc2a1 commit e176065

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/guides-cli/src/Application.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515

1616
use Symfony\Component\Console\Application as BaseApplication;
1717
use Symfony\Component\Console\Command\Command;
18+
use Symfony\Component\Console\Input\InputArgument;
1819
use Symfony\Component\Console\Input\InputDefinition;
20+
use Symfony\Component\Console\Input\InputInterface;
1921
use Symfony\Component\Console\Input\InputOption;
2022

2123
use function count;
@@ -63,4 +65,13 @@ protected function getDefaultInputDefinition(): InputDefinition
6365

6466
return $definition;
6567
}
68+
69+
protected function getCommandName(InputInterface $input): string|null
70+
{
71+
if ($input->getArgument('command') === null) {
72+
return 'run';
73+
}
74+
75+
return $input->getArgument('command');
76+
}
6677
}

0 commit comments

Comments
 (0)