Skip to content

Commit 08d2a89

Browse files
garvinhickingjaapio
authored andcommitted
[BUGFIX] Fix non-working short-options for "config" and "working-dir"
1 parent 20c1b43 commit 08d2a89

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/guides-cli/bin/guides

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use Symfony\Component\Console\Input\ArgvInput;
99
use phpDocumentor\Guides\Cli\Application;
1010
use phpDocumentor\Guides\Cli\DependencyInjection\ApplicationExtension;
1111
use phpDocumentor\Guides\Cli\DependencyInjection\ContainerFactory;
12-
use Symfony\Component\Console\Output\ConsoleOutput;
1312

1413
$vendorDir = dirname(__DIR__) . '/../../vendor';
1514
$autoloadDirectory = $vendorDir . '/autoload.php';
@@ -47,11 +46,13 @@ if (is_file($projectConfig)) {
4746
echo 'Loading guides.xml from ' . $projectConfig . PHP_EOL;
4847
}
4948
// vendor folder was placed directly into the project directory
50-
$containerFactory->addConfigFile($projectConfig);
49+
if ($projectConfig) {
50+
$containerFactory->addConfigFile($projectConfig);
51+
}
5152
}
5253

53-
$workingDir = $input->getParameterOption('--working-dir', getcwd(), true);
54-
$localConfig = $input->getParameterOption('--config', $workingDir, true).'/guides.xml';
54+
$workingDir = $input->getParameterOption(['--working-dir', '-w'], getcwd(), true);
55+
$localConfig = $input->getParameterOption(['--config', '-c'], $workingDir, true) . '/guides.xml';
5556

5657
if (is_file($localConfig) && realpath($localConfig) !== $projectConfig) {
5758
if ($verbosity === 3) {

0 commit comments

Comments
 (0)