diff options
-rw-r--r-- | scripts/commandline.inc | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/scripts/commandline.inc b/scripts/commandline.inc index 6d94a318d..9390890ef 100644 --- a/scripts/commandline.inc +++ b/scripts/commandline.inc @@ -204,3 +204,43 @@ function getUser() return $user; } + +/** "Printf not quiet" */ + +function printfnq() +{ + if (have_option('q', 'quiet')) { + return null; + } + + $cargs = func_num_args(); + + if ($cargs == 0) { + return 0; + } + + $args = func_get_args(); + $format = array_shift($args); + + return vprintf($format, $args); +} + +/** "Print when verbose" */ + +function printfv() +{ + if (!have_option('v', 'verbose')) { + return null; + } + + $cargs = func_num_args(); + + if ($cargs == 0) { + return 0; + } + + $args = func_get_args(); + $format = array_shift($args); + + return vprintf($format, $args); +}
\ No newline at end of file |