Skip to content

Show argument and option definitions in the generated help #49

Description

@HafizMMoaz

$argumentDefinitions and $optionDefinitions carry the type, required flag and (once implemented) default of every input a command accepts, but Help::showCommand() never reads them (src/Commands/Help.php:38-105). It prints only $options, the free text map maintained separately by hand.

The result is that php app help deploy does not tell the user that argument 0 is required, or that --limit must be an integer, even though the console will reject the command for exactly those reasons. The two lists can also drift, since $options and $optionDefinitions are unrelated arrays.

Suggested output:

Arguments:
  0  environment   required, string
  1  tag           optional, string, default "latest"

Options:
  --limit          optional, int
  -g               Shows greeting.

Ideally the definitions become the single source of truth: let a definition carry a description and derive the current Options: block from it, keeping $options supported for commands that already set it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions