Variable OptionHelpersConst

OptionHelpers: {
    getArgumentName: ((opt) => undefined | string);
    hasArgument: ((opt) => boolean);
    renderFlags: ((opt) => string);
    setLong: ((opt, long) => void);
    setShort: ((opt, short) => void);
} = ...

Type declaration

  • getArgumentName: ((opt) => undefined | string)
      • (opt): undefined | string
      • Extract the argument name from an option's 'flags' string.

        Parameters

        • opt: Option<"", undefined, undefined, undefined, false, undefined>

        Returns undefined | string

  • hasArgument: ((opt) => boolean)
      • (opt): boolean
      • Check if an option has an argument.

        Parameters

        • opt: Option<"", undefined, undefined, undefined, false, undefined>

        Returns boolean

  • renderFlags: ((opt) => string)
      • (opt): string
      • Update an Option's 'flags' property from its 'short' and 'long' properties. The flags property is not automatically updated when 'short' or 'long' are changed.

        Parameters

        • opt: Option<"", undefined, undefined, undefined, false, undefined>

        Returns string

  • setLong: ((opt, long) => void)
      • (opt, long): void
      • Set an Option's 'long' name. The 'flags' property is updated accordingly. The '--' prefix is automatically added if not present.

        Parameters

        • opt: Option<"", undefined, undefined, undefined, false, undefined>
        • long: string

        Returns void

  • setShort: ((opt, short) => void)
      • (opt, short): void
      • Set an Option's 'short' name. The 'flags' property is updated accordingly. The '-' prefix is automatically added if not present.

        Parameters

        • opt: Option<"", undefined, undefined, undefined, false, undefined>
        • short: string

        Returns void

Generated using TypeDoc