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': if (!preg_match('/^[0-9]+$/', $cliarg = array_shift($cliargs))) { echo "{$cliargOrig} must be followed by a number.\n" . $syntax; exit(1); } $processor->setTop100Depth(intval($cliarg)); break; case '-n': $processor->setName($cliarg = array_shift($cliargs)); break; case '-l':
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; case '-ds': $processor->setDS($shifted = array_shift($cliargs)); break; case '-td': $processor->setTop100Depth(intval($shifted = array_shift($cliargs))); if (!preg_match('/^[0-9]+$/', $shifted)) { echo "{$cliarg} must be followed by a number.\n"; } exit(1); break;