Skip to content

Commit

Permalink
Fix conflict of option -c with shell completion
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN committed May 20, 2022
1 parent 5c1d95b commit afed93b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
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

0 comments on commit afed93b

Please sign in to comment.