Skip to main content

LayerOptionAction

Custom argparse action for the ogrinspect layer_key keyword option which may be an integer or a string.

Attributes

AttributeTypeDescription
deststringThe name of the attribute on the namespace object where the parsed layer identifier (either an integer index or a string name) will be stored.

Constructor

Signature

def LayerOptionAction(
option_strings: list,
dest: string,
nargs: int|str,
const: any,
default: any,
type: callable,
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`intstr`
constanyThe value to be used if the option is specified without an argument.
defaultanyThe value to be used if the option is not specified.
typecallableThe type to which the command-line argument should be converted.
choicescontainerA container of the allowed values for the argument.
requiredboolean = FalseWhether the command-line option is required.
helpstringA brief description of what the argument does.
metavarstringA name for the argument in usage messages.