https://github.com/phore/phore-cli-tools
cli tools
https://github.com/phore/phore-cli-tools
Last synced: 5 months ago
JSON representation
cli tools
- Host: GitHub
- URL: https://github.com/phore/phore-cli-tools
- Owner: phore
- License: mit
- Created: 2020-04-30T19:30:16.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-12-16T01:06:57.000Z (over 5 years ago)
- Last Synced: 2025-05-26T00:35:32.456Z (about 1 year ago)
- Language: Shell
- Size: 65.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Phore Cli Helper
Boilerplate CLI Tool
## Example
- [Example executable](doc/exampleExec);
### The Main Command
```php
class MainCmd extends PhoreAbstractMainCmd
{
public function invoke(CliContext $context)
{
$opts = $context->getOpts("i:");
$context->dispatchMap([
"import" => new ImportCmd(),
"search" => new SearchCmd()
], $opts);
}
}
```
### The Subcommand
```php
class SearchCmd extends PhoreAbstractCmd
{
public function invoke(CliContext $context)
{
$opts = $context->getOpts();
$context->ask("Do you want to continue?");
}
}
```