Skip to content

Commit

Permalink
Added a quiet option to phpl-generate
Browse files Browse the repository at this point in the history
  • Loading branch information
noccy80 committed Dec 16, 2016
1 parent 7f255a7 commit cc22e22
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions bin/phpl-generate
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ function print_help() {
printf(" -d,--dir <path> Specify working directory\n");
printf(" -s,--status <code> Status of last command\n");
printf(" -r,--raw Don't escape ansi for PS1\n");
printf(" -q Quiet, don't output anything\n");
printf("\n");
}

$opts = cmdl_parse("hd:s:r",[
$opts = cmdl_parse("hd:s:rq",[
"h" => "help",
"r" => "raw",
"d" => "dir:",
Expand All @@ -33,4 +34,11 @@ define("LAST_STATUS", max(0,(int)cmdl_get($opts,'status')));
if (!file_exists(PHPL_STATE)) {
passthru("phpl-reload --all -q");
}
require_once PHPL_STATE;

if (cmdl_get($opts,'q')) {
ob_start();
require_once PHPL_STATE;
ob_end_clean();
} else {
require_once PHPL_STATE;
}

0 comments on commit cc22e22

Please sign in to comment.