garden-cli icon indicating copy to clipboard operation
garden-cli copied to clipboard

A full-featured, yet ridiculously simple commandline parser for your next php cli script. Stop fighting with getopt().

Results 12 garden-cli issues
Sort by recently updated
recently updated
newest added

Hi, I am concerned about the future of this repository and through this pull request I'm hoping to get the library up to PHP 8.1's standard and compatibility. Some notes:...

Running garden-cli with PHP 8.1.5 gives me: > Deprecated: Return type of Garden\Cli\Schema\OptSchema::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress...

Added some return types where possible and migrated from `strftime` to `date`. Fixes GH-42

There is a way to make a parameter accept multiple arguments? Example: ` $cli->arg( 'SINGLE', ''...,' true ); $cli->arg( 'MULTIPLE', ''...,' true. true // multiple ); ` Usage: ` $...

Currently there is no way to get the commands registered by the `CLI::command()` method.

It would be nice if you could ask for the usage / help details programmatically (I.e public methods on the `Cli` class for: `getUsage()` or `getHelp()` / `getHelp($command)` )

Type: Feature Request

If I enter `-?` to get the help for a registered command as suggested, nothing happens. $ php cli.php auth:token -? zsh: no matches found: -? The long help with...

@acharron-hl I saw PHP8.4 upgrade in the garden-container so upgraded it's version in this repo too.

Use ```php $this->addCommandClass(\App\Command\Something::class, 'run', [self::OPT_REQUIRED => ['id', 'name']]); ``` if only some fields are required or ```php $this->addCommandClass(\App\Command\Something::class, 'run', [self::OPT_REQUIRED_ALL => true]); ``` if all of them are required for...

This should address #49 by adding the following explicit nullable declarations: 1. `Cli::parse`: `$argv` 2. `Cli::validateType` `$def` The underlying issue is not visible when testing with PHP 8.4 and PHPUnit...