Exemplo n.º 1
0
function writeln($input = '')
{
    return \Sauce\Shell\CLI::writeln($input);
}
Exemplo n.º 2
0
 private static function search($q = '')
 {
     \Sauce\Shell\CLI::printf("\n  \\ccyan(Available tasks:)\\c\n\n");
     $max = 0;
     foreach (static::$tasks as $ns => $set) {
         foreach (array_keys($set) as $k) {
             $cmd = $k != 'default' ? "{$ns}:{$k}" : $ns;
             $max = ($test = strlen($cmd)) > $max ? $test : $max;
         }
     }
     foreach (static::$tasks as $ns => $set) {
         if (!$q or strpos($ns, $q) === 0) {
             foreach ($set as $key => $val) {
                 $cmd = $key != 'default' ? "{$ns}:{$key}" : $ns;
                 $pad = str_repeat(' ', $max + 2 - strlen($cmd));
                 if (!empty($val['desc'])) {
                     \Sauce\Shell\CLI::printf("  \\cbrown(%s)\\c{$pad}\\cdark_gray(#)\\c \\clight_gray(%s)\\c\n", $cmd, $val['desc']);
                 } else {
                     \Sauce\Shell\CLI::printf("  \\cbrown(%s)\\c\n", $cmd);
                 }
             }
         }
     }
     \Sauce\Shell\CLI::writeln();
 }