38 lines
962 B
PHP
38 lines
962 B
PHP
<?php # -*- coding: utf-8 mode: php -*- vim:sw=2:sts=2:et:ai:si:sta:fenc=utf-8
|
|
require(__DIR__.'/../../vendor/autoload.php');
|
|
|
|
use nur\cli\Application;
|
|
use nur\msg;
|
|
|
|
Application::run(new class extends Application {
|
|
const ARGS = [
|
|
"merge" => Application::ARGS,
|
|
["-o", "args" => ["value", null], "name" => "option"],
|
|
["args" => ["value"], "name" => "args"],
|
|
# ["args" => ["value", "value"], "name" => "args"],
|
|
# ["args" => ["value", ["value"]], "name" => "args"],
|
|
# ["args" => ["value", null], "name" => "args"],
|
|
];
|
|
|
|
private $option, $args;
|
|
|
|
function main() {
|
|
Txx("option", $this->option);
|
|
Txx("args", $this->args);
|
|
|
|
msg::group("prefix1", 1);
|
|
msg::failure("aie1");
|
|
msg::end();
|
|
|
|
msg::group("prefix2", 2);
|
|
msg::failure("aie21");
|
|
msg::failure("aie22");
|
|
msg::end();
|
|
|
|
msg::group("hidden by default", null, msg::MINOR);
|
|
msg::failure("aie31");
|
|
msg::failure("aie32");
|
|
msg::end();
|
|
}
|
|
});
|