phore / cli-tools
Cli helper tools
v1.0
2020-05-01 11:12 UTC
Requires
- php: >=7.2
- psr/log: ^1.1
Requires (Dev)
- phore/log: *
- phpunit/phpunit: *
Suggests
- phore/log: Enable advanced logging / out capabilities
This package is auto-updated.
Last update: 2026-03-16 12:34:39 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?"); } }