Skip to content

Commit

Permalink
Tweak documentation for bin/phpyacc
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Oct 19, 2019
1 parent 6e86fc4 commit b9bf8c0
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions bin/phpyacc
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ use PhpYacc\Grammar\Context;

foreach (array(__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php') as $file) {
if (file_exists($file)) {
define('PHPUNIT_COMPOSER_INSTALL', $file);
define('COMPOSER_INSTALL', $file);

break;
}
}

unset($file);

if (!defined('PHPUNIT_COMPOSER_INSTALL')) {
if (!defined('COMPOSER_INSTALL')) {
fwrite(
STDERR,
'You need to set up the project dependencies using Composer:' . PHP_EOL . PHP_EOL .
Expand All @@ -25,7 +25,7 @@ if (!defined('PHPUNIT_COMPOSER_INSTALL')) {
die(1);
}

require PHPUNIT_COMPOSER_INSTALL;
require COMPOSER_INSTALL;

$grammarFile = end($argv);

Expand Down Expand Up @@ -66,7 +66,7 @@ for ($i = 1; $i < $argc - 1; $i++) {
break;
case '-m':
if ($i === $argc - 2) {
error("Class name required for option -p");
error("Skeleton file required for option -m");
}
$skeleton = file_get_contents($argv[++$i]);
break;
Expand All @@ -89,8 +89,10 @@ Usage: phpyacc [options] grammar.y
Options:
-p <name> The name of the class to generate
-x Enable debug mode
-t Set the T flag for templates
-a Set the A flag for templates
-v Enable verbose mode
-t Set the T flag for templates (inclusion of debug information)
-a Set the A flag for templates (unused)
-m <skeleton> Path to the skeleton file to use
EOH;
Expand All @@ -101,4 +103,4 @@ function error(string $message)
echo $message . "\n";
help();
exit(2);
}
}

0 comments on commit b9bf8c0

Please sign in to comment.