phore/cli-tools

Cli helper tools

v1.0 2020-05-01 11:12 UTC

This package is auto-updated.

Last update: 2024-12-16 09:22:41 UTC


README

Boilerplate CLI Tool

Example

The Main Command

class MainCmd extends PhoreAbstractMainCmd
{

    public function invoke(CliContext $context)
    {
        $opts = $context->getOpts("i:");

        $context->dispatchMap([
            "import" => new ImportCmd(),
            "search" => new SearchCmd()
        ], $opts);
    }
}

The Subcommand

class SearchCmd extends PhoreAbstractCmd
{

    public function invoke(CliContext $context)
    {
        $opts = $context->getOpts();
        $context->ask("Do you want to continue?");

    }
}