Skip to main content

ListOptionAction

Custom argparse action for ogrinspect keywords that require a string list. If the string is 'True'/'true' then the option value will be a boolean instead.

Attributes

AttributeTypeDescription
deststringThe name of the attribute on the namespace object where the parsed list or boolean value will be stored.

Constructor

Signature

def ListOptionAction(
option_strings: list,
dest: string,
nargs: int|string,
const: any,
default: any,
type: type,
choices: container,
required: boolean = False,
help: string,
metavar: string
) - > null

Parameters

NameTypeDescription
option_stringslistA list of command-line option strings which should be associated with this action.
deststringThe name of the attribute to hold the created object.
nargs`intstring`
constanyThe value to be used if the action is selected but no arguments are consumed.
defaultanyThe value to be used if the option is not present on the command line.
typetypeThe type to which the command-line argument should be converted.
choicescontainerA container of the allowable values for the argument.
requiredboolean = FalseWhether or not the command-line option may be omitted.
helpstringA brief description of what the argument does.
metavarstringA name for the argument in usage messages.