summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Utils/CLI.php3
-rw-r--r--tests/Utils/CLITest.php10
2 files changed, 13 insertions, 0 deletions
diff --git a/src/Utils/CLI.php b/src/Utils/CLI.php
index 0a34dea..b6ce35e 100644
--- a/src/Utils/CLI.php
+++ b/src/Utils/CLI.php
@@ -48,6 +48,9 @@ class CLI
$params = $this->getopt(
'hq:f:', $longopts
);
+ if ($params === false) {
+ return false;
+ }
$this->mergeLongOpts($params, $longopts);
if (! isset($params['f'])) {
$params['f'] = 'cli';
diff --git a/tests/Utils/CLITest.php b/tests/Utils/CLITest.php
index 96c3f67..3087f29 100644
--- a/tests/Utils/CLITest.php
+++ b/tests/Utils/CLITest.php
@@ -48,6 +48,11 @@ class CLITest extends TestCase
'Usage: highlight-query --query SQL [--format html|cli|text]' . "\n",
1,
),
+ array(
+ false,
+ '',
+ 1,
+ ),
);
}
@@ -87,6 +92,11 @@ class CLITest extends TestCase
'Usage: lint-query --query SQL' . "\n",
1,
),
+ array(
+ false,
+ '',
+ 1,
+ ),
);
}
}