NAME

Getopt::Pad::Spec::Arg - One positional arg of a spec (internal)

DESCRIPTION

This module is internal to Getopt::Pad. It is not part of the public API and can change without notice. Programs use "GetOptions" in Getopt::Pad; this page is for people working on Getopt::Pad itself.

An arg spec holds the checked settings of one positional arg: its short name, the reader name derived from it, the type (a Getopt::Pad::Type instance that must take a value) and the keys required, multiple, help, typehint and processValue. The meaning of each key is documented in "ARG SPECS" in Getopt::Pad. Unknown keys are a spec error. Spec errors start with the optional where constructor param, which the declaring Getopt::Pad::Spec::Level sets to its command path (command 'image resize': ).

The order rules between args (a required arg after an optional one, and multiple on the last arg only) are checked by Getopt::Pad::Spec::Level; the values are checked by Getopt::Pad::Parser when it consumes the positional words.

METHODS

The readers short, reader, type, typeName, required, multiple, help, typehint and processValue, and:

processedValue($result, $value)

The reader value with every single value in it replaced by what the processValue coderef returns when called with $result and the value. An arg that was not given (undef) is left alone. Without processValue the value is returned as it is.

typeLabel

The tag the help output shows: typehint, or the type's label.

SEE ALSO

Getopt::Pad::Spec::Level, Getopt::Pad::Parser

AUTHOR

davenonymous <perl@davenonymous.com>

COPYRIGHT AND LICENSE

Copyright 2026 davenonymous

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.