Ejemplo n.º 1
0
 case '-h':
 case '--help':
     echo $syntax_long;
     exit(1);
 case '-tz':
     $args['timezone'] = $cliarg = array_shift($cliargs);
     break;
 case '-d':
     $processor->setDelim($cliarg = array_shift($cliargs));
     break;
 case '-t':
     if (!preg_match('/^[0-9]+$/', $cliarg = array_shift($cliargs))) {
         echo "{$cliargOrig} must be followed by a number.\n" . $syntax;
         exit(1);
     }
     $processor->setTotalsDepth(intval($cliarg));
     break;
 case '-nt':
     $processor->setNoTree(TRUE);
     break;
 case '-mt':
     if (!preg_match('/^[0-9]+$/', $cliarg = array_shift($cliargs))) {
         echo "{$cliargOrig} must be followed by a number.\n" . $syntax;
         exit(1);
     }
     $processor->setMaxTreeSize(intval($cliarg));
     break;
 case '-ds':
     $processor->setDS($cliarg = array_shift($cliargs));
     break;
 case '-td':
Ejemplo n.º 2
0
 $shifted = TRUE;
 switch ($cliarg) {
     case '/?':
     case '-?':
     case '-h':
     case '--help':
         echo $syntax_long;
         exit(1);
     case '-tz':
         $args['timezone'] = $shifted = array_shift($cliargs);
         break;
     case '-d':
         $processor->setDelim($shifted = array_shift($cliargs));
         break;
     case '-t':
         $processor->setTotalsDepth(intval($shifted = array_shift($cliargs)));
         if (!preg_match('/^[0-9]+$/', $shifted)) {
             echo "{$cliarg} must be followed by a number.\n";
         }
         exit(1);
         break;
     case '-nt':
         $processor->setNoTree(TRUE);
         break;
     case '-mt':
         $processor->setMaxTreeSize(intval($shifted = array_shift($cliargs)));
         if (!preg_match('/^[0-9]+$/', $shifted)) {
             echo "{$cliarg} must be followed by a number.\n";
         }
         exit(1);
         break;