Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix conflict of option -c with shell completion #7988

Merged
merged 1 commit into from
May 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/Psalm/Internal/Cli/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Psalm\Internal\PluginManager\Command\ShowCommand;
use Psalm\Internal\PluginManager\PluginListFactory;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\InputOption;

use function dirname;
use function getcwd;
Expand Down Expand Up @@ -41,10 +40,6 @@ public static function run(): void
new DisableCommand($plugin_list_factory),
]);

$app->getDefinition()->addOption(
new InputOption('config', 'c', InputOption::VALUE_REQUIRED, 'Path to Psalm config file')
);

$app->setDefaultCommand('show');
$app->run();
}
Expand Down
2 changes: 2 additions & 0 deletions src/Psalm/Internal/PluginManager/Command/DisableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use UnexpectedValueException;
Expand Down Expand Up @@ -41,6 +42,7 @@ protected function configure(): void
InputArgument::REQUIRED,
'Plugin name (fully qualified class name or composer package name)'
)
->addOption('config', 'c', InputOption::VALUE_REQUIRED, 'Path to Psalm config file')
->addUsage('vendor/plugin-package-name [-c path/to/psalm.xml]');
$this->addUsage('\'Plugin\Class\Name\' [-c path/to/psalm.xml]');
}
Expand Down
2 changes: 2 additions & 0 deletions src/Psalm/Internal/PluginManager/Command/EnableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use UnexpectedValueException;
Expand Down Expand Up @@ -41,6 +42,7 @@ protected function configure(): void
InputArgument::REQUIRED,
'Plugin name (fully qualified class name or composer package name)'
)
->addOption('config', 'c', InputOption::VALUE_REQUIRED, 'Path to Psalm config file')
->addUsage('vendor/plugin-package-name [-c path/to/psalm.xml]');
$this->addUsage('\'Plugin\Class\Name\' [-c path/to/psalm.xml]');
}
Expand Down
2 changes: 2 additions & 0 deletions src/Psalm/Internal/PluginManager/Command/ShowCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Psalm\Internal\PluginManager\PluginListFactory;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use UnexpectedValueException;
Expand Down Expand Up @@ -37,6 +38,7 @@ protected function configure(): void
$this
->setName('show')
->setDescription('Lists enabled and available plugins')
->addOption('config', 'c', InputOption::VALUE_REQUIRED, 'Path to Psalm config file')
->addUsage('[-c path/to/psalm.xml]');
}

Expand Down