This documentation describes unreleased changes on the main branch.

#[Option]

Attribute on parameters.

use Saij\WpAppFramework\WpCli\Option;

Marks a parameter of a #[CliSubcommand] method as option, --name=<name> with the parameter name in kebab-case. A bool parameter is a flag, --name, and defaults to false. A parameter without default value is a required option.

Arguments

#[Option(string $description = '')]
ParameterTypeDefaultDescription
descriptionstring''The description of the option in the help; empty for none.