Skip to content

Commit 8b9ec23

Browse files
author
Yaroslav Voronoy
committed
Fixed #1: Bash Completion List should exclude self command
1 parent 3fe005e commit 8b9ec23

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Console/Command/BashCompletionCommand.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@ protected function configure()
4444
protected function execute(InputInterface $input, OutputInterface $output)
4545
{
4646
$description = new ApplicationDescription($this->getApplication());
47-
$this->commandCollection->setItems($description->getCommands());
47+
$commands = $description->getCommands();
48+
foreach ($commands as $command) {
49+
if ($command->getName() == self::COMMAND_NAME) {
50+
continue;
51+
}
52+
$this->commandCollection->add($command);
53+
}
4854
$result = $this->bashCompletion->generateCompletionList(
4955
$input->getArgument(self::INPUT_ARG_NAME)
5056
);

0 commit comments

Comments
 (0)