phore/cli-tools

Cli helper tools

Installs: 541

Dependents: 3

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

Language:Shell

pkg:composer/phore/cli-tools

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

This package is auto-updated.

Last update: 2025-10-16 11:35:32 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?");

    }
}