X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=examples%2Fcli.php;fp=examples%2Fcli.php;h=650ca8541e62f121766dabe369872103ce6b27a9;hb=2451d97f1cb7b97e445b4dd839835b8673a4d0fc;hp=0000000000000000000000000000000000000000;hpb=3958595e9ff27162ae918db1453ddecd4840d481;p=m6w6%2Fseekat diff --git a/examples/cli.php b/examples/cli.php new file mode 100644 index 0000000..650ca85 --- /dev/null +++ b/examples/cli.php @@ -0,0 +1,24 @@ + "token ".getenv("GITHUB_TOKEN") +]); +array_shift($argv); + +($self = function($api) use(&$self) { + global $argv; + + while (null !== ($arg = array_shift($argv))) { + if ("." === $arg) { + $api->then($self); + return; + } + $api = $api->$arg; + } + + echo $api, "\n"; +})($api); + +$api->send();