Type alias WithParam

WithParam: {
    complete?: CompleteCallback;
    inline?: false | "always";
    paramName?: string;
    positional?: true | string;
}

Defines attributes common to options with parameters.

Type declaration

  • Optional Readonly complete?: CompleteCallback

    A custom callback for word completion. It should return the list of completion words. If it throws an error, it is ignored, and the default completion message is thrown instead.

  • Optional Readonly inline?: false | "always"

    Whether inline parameters should be disallowed or required for this option. It can only be specified for monadic or delimited options.

  • Optional Readonly paramName?: string

    The option parameter name. Replaces the option type in the help message parameter column.

  • Optional Readonly positional?: true | string

    Whether the option accepts positional arguments. There may be at most one option with this setting.

    If set, then any argument not recognized as an option name will be considered positional. Additionally, if a string is specified as positional marker, then all arguments beyond this marker will be considered positional.

    We recommend also setting WithBasic.preferredName to some explanatory name.