cli-argument-helper - v2.3.0
    Preparing search index...
    • Get a boolean value from the argument list. By default, if none of the acceptedValues are matched, it will try to parse the value as an integer and return true if it is greater than or equal to 1, false otherwise.

      It will print a trace message if the string can be parsed into a number and it is below 0, but it will still return false either way.

      Parameters

      • args: string[]

        Argument list

      • index: number

        Index of the argument to take as a boolean

      • acceptedValues: ArgumentHelperBooleanAcceptedValues = booleanDefaults.acceptedValues

        Values that are accepted for both true and false. Defaults to defaultAcceptedBooleanValues

      Returns null | boolean

      Boolean value or null if the value is not a boolean