{
return (bool)$arg;
}
-
+
static function cli_arg_typ_select($arg, $cfg)
{
if (!in_array($arg, array_keys($cfg['select'])))
}
return $f;
}
-
+
static function cli_arg_typ_file($arg)
{
$f = realpath($arg);
}
return $f;
}
-
+
static function cli_arg_typ_filenew($arg)
{
$d = dirname($arg);
{
return "This help.";
}
-
+
function cli_cmd_run_help()
{
$argv = $this->argv;
-
+
echo <<<EOF
$argv[0] <command> [options]
$phar = new Phar($archive, 0, $alias);
$phar->startBuffering();
-
+
if (isset($stub))
{
$phar->setStub(file_get_contents($stub));
break;
case 'bz2':
case 'bzip2':
- $phar->compressAllFilesBZIP2();
+ $phar->compressAllFilesBZIP2();
break;
default:
break;
$this->argv = $argv;
$this->cmds = self::getCommands($this);
$this->typs = self::getArgTyps($this);
-
+
if ($argc < 2)
{
echo "No command given, check ${argv[0]} help\n";
exit(1);
}
}
-
+
call_user_func(array($this, $this->cmds[$command]['run']), $this->args);
}
$a = array();
$r = new ReflectionClass($cmdclass);
$l = strlen($prefix);
-
+
foreach($r->getMethods() as $m)
{
if (substr($m->name, 0, $l) == $prefix)
{
return self::getSubFuncs($cmdclass, 'cli_cmd_', array('arg','inf','run'));
}
-
+
static function getArgTyps(CLICommand $cmdclass)
{
return self::getSubFuncs($cmdclass, 'cli_arg_', array('typ'));
$phar = new Phar($archive, 0, $alias);
$phar->startBuffering();
-
+
if (isset($stub))
{
$phar->setStub(file_get_contents($stub));
break;
case 'bz2':
case 'bzip2':
- $phar->compressAllFilesBZIP2();
+ $phar->compressAllFilesBZIP2();
break;
default:
break;