Skip to content

Commit 64435f0

Browse files
committed
Add options (project & global) validation
1 parent a674c39 commit 64435f0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Command/InitCommand.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
8787

8888
$project = $input->getOption('project');
8989

90-
if (!$project || !in_array($project, $this->projects)) {
90+
if ($global && $project) {
91+
throw new \Exception('Options `project` and `global` can not used in combination.');
92+
}
93+
94+
if (!$global && (!$project || !in_array($project, $this->projects))) {
9195
throw new \Exception(
9296
sprintf(
9397
'You must provide a valid project value (%s)',

0 commit comments

Comments
 (0)