Skip to content

Commit 32c8ff8

Browse files
committed
[!!!][TASK] Make output an option instead of argument
This way it can be set indepenently from the input
1 parent 830c0df commit 32c8ff8

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ jobs:
3535
dependency-versions: "highest"
3636

3737
- name: "Run guides-cli"
38-
run: "vendor/bin/guides -vvv --no-progress docs /tmp/test --fail-on-log"
38+
run: 'vendor/bin/guides -vvv --no-progress docs --output='/tmp/test' --fail-on-log"

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ test-integration: ## Runs integration tests with phpunit/phpunit
4444

4545
.PHONY: test-docs
4646
test-docs: ## Generate projects docs without warnings
47-
$(PHP_BIN) vendor/bin/guides -vvv --no-progress docs /tmp/test --fail-on-log
47+
$(PHP_BIN) vendor/bin/guides -vvv --no-progress docs --output="/tmp/test" --fail-on-log
4848

4949
.PHONY: cleanup
5050
cleanup: cleanup-tests cleanup-build cleanup-cache

packages/guides-cli/src/Command/Run.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ public function __construct(
5959
InputArgument::OPTIONAL,
6060
'Directory to read for files',
6161
);
62-
$this->addArgument(
62+
$this->addOption(
6363
'output',
64-
InputArgument::OPTIONAL,
64+
null,
65+
InputOption::VALUE_REQUIRED,
6566
'Directory to read for files',
6667
);
6768

@@ -125,8 +126,8 @@ private function getSettingsOverridenWithInput(InputInterface $input): ProjectSe
125126
$settings->setInput((string) $input->getArgument('input'));
126127
}
127128

128-
if ($input->getArgument('output')) {
129-
$settings->setOutput((string) $input->getArgument('output'));
129+
if ($input->getOption('output')) {
130+
$settings->setOutput((string) $input->getOption('output'));
130131
}
131132

132133
if ($input->getOption('input-file')) {

tests/Integration/IntegrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function testHtmlIntegration(
6565
$input = new ArrayInput(
6666
[
6767
'input' => $inputPath,
68-
'output' => $outputPath,
68+
'--output' => $outputPath,
6969
'--log-path' => $outputPath . '/logs',
7070
],
7171
$command->getDefinition(),

0 commit comments

Comments
 (0)