phore / cli-tools
Cli helper tools
Installs: 530
Dependents: 3
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
Language:Shell
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: 2024-10-16 09:02:20 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?"); } }