nur-sery/nur_tbin/test-args2.php

38 lines
959 B
PHP
Raw Normal View History

2023-12-03 22:10:18 +04:00
<?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();
}
});