Skip to content

Commit

Permalink
Core: Fix some issues with version reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
SMillerDev committed Jul 21, 2017
1 parent 9ed179c commit 3eb56bd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/PHPDraft/In/Tests/ApibFileParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function testFilenameSetup()
* Test if exception when the file doesn't exist
* @expectedException \RuntimeException
* @expectedExceptionCode 1
* @expectedExceptionMessageRegExp "API File not found: [a-zA-Z0-9\/]*\/drafter\/non_existing_including_apib"
* @expectedExceptionMessageRegExp "API File not found: [\w\W]*\/drafter\/non_existing_including_apib"
*
* @return void
*/
Expand Down
22 changes: 11 additions & 11 deletions src/PHPDraft/Out/UI.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static function main($argv = [])

if (!isset($argv[1])) {
file_put_contents('php://stderr', 'Not enough arguments' . PHP_EOL);
self::help();
(new UI)->help();
throw new \RuntimeException('', 1);
}

Expand All @@ -60,12 +60,12 @@ public static function main($argv = [])

if (boolval(preg_match('/^\-/', $argv[1]))) {
if (isset($options['h'])) {
self::help();
(new UI)->help();
throw new \RuntimeException('', 0);
}

if (isset($options['v'])) {
self::version();
(new UI)->version();
throw new \RuntimeException('', 0);
}

Expand Down Expand Up @@ -104,14 +104,14 @@ public static function main($argv = [])
public function help()
{
echo 'This is a parser for API Blueprint files in PHP.' . PHP_EOL . PHP_EOL;
echo "The following options can be used:.\n";
echo "\t-f\tSpecifies the file to parse.\n";
echo "\t-t\tSpecifies the template to use. (defaults to 'default')\n";
echo "\t-s\tSort displayed values [All|None|Structures|Webservices] (defaults to the way the objects are in the file)\n";
echo "\t-i\tSpecifies an image to display in the header.\n";
echo "\t-c\tSpecifies a CSS file to include (value is put in a link element without checking).\n";
echo "\t-j\tSpecifies a JS file to include (value is put in a script element without checking).\n";
echo "\t-h\tDisplays this text.\n";
echo "The following options can be used:.".PHP_EOL;
echo "\t-f\tSpecifies the file to parse.".PHP_EOL;
echo "\t-t\tSpecifies the template to use. (defaults to 'default')".PHP_EOL;
echo "\t-s\tSort displayed values [All|None|Structures|Webservices] (defaults to the way the objects are in the file)".PHP_EOL;
echo "\t-i\tSpecifies an image to display in the header.".PHP_EOL;
echo "\t-c\tSpecifies a CSS file to include (value is put in a link element without checking).".PHP_EOL;
echo "\t-j\tSpecifies a JS file to include (value is put in a script element without checking).".PHP_EOL;
echo "\t-h\tDisplays this text.".PHP_EOL;
}

/**
Expand Down

0 comments on commit 3eb56bd

Please sign in to comment.