2023-12-26 23:27:51 +04:00
|
|
|
#!/usr/bin/php
|
|
|
|
<?php
|
|
|
|
require(__DIR__.'/../vendor/autoload.php');
|
|
|
|
|
2023-12-27 01:39:08 +04:00
|
|
|
use nur\sery\output\StdMessenger;
|
2023-12-26 23:27:51 +04:00
|
|
|
|
|
|
|
$params = [];
|
|
|
|
$count = count($argv) - 1;
|
|
|
|
for ($i = 1; $i <= $count; $i++) {
|
|
|
|
switch ($argv[$i]) {
|
|
|
|
case "-n":
|
|
|
|
$params["color"] = false;
|
|
|
|
break;
|
|
|
|
case "+n":
|
|
|
|
$params["color"] = true;
|
|
|
|
break;
|
|
|
|
case "-d":
|
|
|
|
$params["debug"] = true;
|
|
|
|
break;
|
|
|
|
case "+d":
|
|
|
|
$params["debug"] = false;
|
|
|
|
break;
|
2023-12-27 01:39:08 +04:00
|
|
|
case "-L":
|
|
|
|
$i++;
|
|
|
|
$params["output"] = $argv[$i];
|
|
|
|
break;
|
2023-12-26 23:27:51 +04:00
|
|
|
case "-D":
|
|
|
|
$params["default_level"] = "debug";
|
|
|
|
$params["debug"] = true;
|
|
|
|
break;
|
|
|
|
case "-N":
|
|
|
|
$params["default_level"] = "normal";
|
|
|
|
break;
|
|
|
|
case "-M":
|
|
|
|
$params["default_level"] = "major";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2023-12-27 01:39:08 +04:00
|
|
|
$c = new StdMessenger($params);
|
2023-12-26 23:27:51 +04:00
|
|
|
|
|
|
|
$c->section("section");
|
|
|
|
|
|
|
|
$c->title("title");
|
|
|
|
$c->desc("desc");
|
|
|
|
$c->print("print");
|
|
|
|
|
|
|
|
$c->action("action");
|
|
|
|
$c->step("step");
|
|
|
|
$c->success("action success");
|
|
|
|
|
|
|
|
$c->action("action");
|
|
|
|
$c->step("step");
|
|
|
|
$c->failure("action failure");
|
|
|
|
|
|
|
|
$c->action("action");
|
|
|
|
$c->success("action success");
|
|
|
|
|
|
|
|
$c->action("action");
|
|
|
|
$c->failure("action failure");
|
|
|
|
|
|
|
|
$c->action("action0");
|
|
|
|
$c->action("action1");
|
|
|
|
$c->action("action2");
|
|
|
|
$c->success("action2 success");
|
|
|
|
$c->success("action1 success");
|
|
|
|
$c->success("action0 success");
|
|
|
|
|
2023-12-27 00:34:59 +04:00
|
|
|
$c->action("action");
|
|
|
|
$c->step("step");
|
|
|
|
$c->success();
|
|
|
|
|
|
|
|
$c->action("action");
|
|
|
|
$c->step("step");
|
|
|
|
$c->failure();
|
|
|
|
|
|
|
|
$c->action("action");
|
|
|
|
$c->success();
|
|
|
|
|
|
|
|
$c->action("action");
|
|
|
|
$c->failure();
|
|
|
|
|
|
|
|
$c->action("action0");
|
|
|
|
$c->action("action1");
|
|
|
|
$c->action("action2");
|
|
|
|
$c->success();
|
|
|
|
$c->success();
|
|
|
|
$c->success();
|
|
|
|
|
2023-12-26 23:27:51 +04:00
|
|
|
$c->info("info");
|
|
|
|
$c->note("note");
|
|
|
|
$c->warn("warn");
|
|
|
|
$c->error("error");
|
|
|
|
|
|
|
|
$c->end();
|
|
|
|
|
|
|
|
$c->title("title0");
|
|
|
|
$c->title("title1");
|
|
|
|
$c->print("print under title1");
|
|
|
|
$c->end();
|
|
|
|
$c->print("print under title0");
|
|
|
|
$c->end();
|
|
|
|
|
|
|
|
$c->end(true);
|
|
|
|
|
|
|
|
$c->section("multi-line\nsection");
|
|
|
|
$c->title("multi-line\ntitle");
|
|
|
|
$c->title("another\ntitle");
|
|
|
|
$c->print("multi-line\nprint");
|
2023-12-27 01:39:08 +04:00
|
|
|
$c->info("multi-line\ninfo");
|
|
|
|
$c->action("multi-line\naction");
|
|
|
|
$c->success();
|
|
|
|
$c->action("multi-line\naction");
|
|
|
|
$c->step("multi-line\nstep");
|
|
|
|
$c->failure();
|
|
|
|
$c->action("multi-line\naction");
|
|
|
|
$c->step("multi-line\nstep");
|
|
|
|
$c->success("multi-line\nsuccess");
|
2023-12-26 23:27:51 +04:00
|
|
|
$c->end(true);
|