Interface CommandOptions

Command definition options

Hierarchy

  • CommandOptions

Properties

long?: string

Detailed description of the command

Remarks

Here you can write detailed usage instructions including some usage examples

prepare?: ((flags: Flags, cmd: Command) => undefined | ((args: string[], cmd: Command) => void))

Type declaration

    • (flags: Flags, cmd: Command): undefined | ((args: string[], cmd: Command) => void)
    • If you want to define flags for a command, you should not specify the 'run' attribute but the 'prepare' attribute

      Remarks

      The passed 'flgas' is an example of the Flags that are associated with this command to specify flags for the command

      If the callback function specified by prepare returns non-undefined, its return value will override the 'run' attribute, and if it returns undefined, it will not affect the run attribute

      Parameters

      Returns undefined | ((args: string[], cmd: Command) => void)

run?: ((args: string[], cmd: Command) => void)

Type declaration

    • (args: string[], cmd: Command): void
    • Called when the user specifies to execute this command/subcommand

      Parameters

      Returns void

short?: string

Short description of the command

Remarks

Line breaks are not allowed, because they will be displayed when listing subcommands. If there is a line break, it may disrupt the typesetting of the description information

use: string

Command name

Remarks

The name must match the regular expression /^[a-zA-Z][a-zA-Z0-9-_.]*$/u, as you can see some special symbols are not allowed this is intentional, Because I think using strange special symbols as command names will give users a very bad experience

Generated using TypeDoc