NAME

Getopt::Pad::Util - Helper functions (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.

FUNCTIONS

All functions are exported on request.

camelize($name)

The reader name for an option or arg name: split at dashes and underscores, every part after the first with its first letter upper case (log-level becomes logLevel). A spec error if the result is not a valid Perl identifier.

isValidName($name)

Whether $name is a valid option name, alias, arg name or command name: a letter, followed by word characters or dashes.

specError($format, @args)

Dies with Getopt::Pad spec: MESSAGE at FILE line LINE., where FILE and LINE are those of the first caller outside Getopt::Pad, normally the GetOptions call.

expandTilde($path)

Replaces a leading ~ (alone or followed by /) with $HOME. Returns the path unchanged when HOME is not set.

useColor($handle)

Whether output to $handle should be colored: it is a terminal, NO_COLOR is empty or unset, and TERM is not dumb.

SEE ALSO

Getopt::Pad

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.