diff options
-rw-r--r-- | src/Utils/CLI.php | 3 | ||||
-rw-r--r-- | tests/Utils/CLITest.php | 18 |
2 files changed, 15 insertions, 6 deletions
diff --git a/src/Utils/CLI.php b/src/Utils/CLI.php index 79e88dc..4881c5b 100644 --- a/src/Utils/CLI.php +++ b/src/Utils/CLI.php @@ -32,6 +32,7 @@ class CLI public function usageHighlight() { echo "Usage: highlight-query --query SQL [--format html|cli|text]\n"; + echo " cat file.sql | highlight-query\n"; } public function getopt($opt, $long) @@ -100,6 +101,7 @@ class CLI public function usageLint() { echo "Usage: lint-query --query SQL\n"; + echo " cat file.sql | lint-query\n"; } public function parseLint() @@ -159,6 +161,7 @@ class CLI public function usageTokenize() { echo "Usage: tokenize-query --query SQL\n"; + echo " cat file.sql | tokenize-query\n"; } public function parseTokenize() diff --git a/tests/Utils/CLITest.php b/tests/Utils/CLITest.php index d9eadae..0f3b9e6 100644 --- a/tests/Utils/CLITest.php +++ b/tests/Utils/CLITest.php @@ -83,13 +83,15 @@ class CLITest extends TestCase ], [ ['h' => true], - 'Usage: highlight-query --query SQL [--format html|cli|text]' . "\n", + 'Usage: highlight-query --query SQL [--format html|cli|text]' . "\n" . + ' cat file.sql | highlight-query' . "\n", 0, ], [ [], 'ERROR: Missing parameters!' . "\n" . - 'Usage: highlight-query --query SQL [--format html|cli|text]' . "\n", + 'Usage: highlight-query --query SQL [--format html|cli|text]' . "\n" . + ' cat file.sql | highlight-query' . "\n", 1, ], [ @@ -136,13 +138,15 @@ class CLITest extends TestCase ], [ ['h' => true], - 'Usage: lint-query --query SQL' . "\n", + 'Usage: lint-query --query SQL' . "\n" . + ' cat file.sql | lint-query' . "\n", 0, ], [ [], 'ERROR: Missing parameters!' . "\n" . - 'Usage: lint-query --query SQL' . "\n", + 'Usage: lint-query --query SQL' . "\n" . + ' cat file.sql | lint-query' . "\n", 1, ], [ @@ -189,13 +193,15 @@ class CLITest extends TestCase ], [ ['h' => true], - 'Usage: tokenize-query --query SQL' . "\n", + 'Usage: tokenize-query --query SQL' . "\n" . + ' cat file.sql | tokenize-query' . "\n", 0, ], [ [], 'ERROR: Missing parameters!' . "\n" . - 'Usage: tokenize-query --query SQL' . "\n", + 'Usage: tokenize-query --query SQL' . "\n" . + ' cat file.sql | tokenize-query' . "\n", 1, ], [ |