Commit 91a18625 authored by Evan Prodromou's avatar Evan Prodromou

printfv and printfq functions in commandline.inc

parent 556a2a8f
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment