The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

CLI::Gwrap::Opt.pm - a single CLI option item for CLI::Gwrap

VERSION

version 0.030

DESCRIPTION

CLI::Gwrap::Opt encapsulates individual options for CLI::Gwrap.

ATTRIBUTES

type => 'string'

A string naming the type of option (check, radio, string, etc).

name => [ 'name', 'long name' ]

This is the name of the option as used on the command line, and a description that should be more useful for casual users. When name is set, the default joiner is also determined (from the length of 'name'), unless the joiner has already been set. Single letter 'name's get a space (' ') joiner, and longer 'name's get an equals sign ('=').

description' => (is => 'ro', isa => Str);

A short description of the option which is usually presented to the user when the mouse 'hovers' over the option.

state => 'string'

Initial state of the option. The option type determines the context for the state: checks are true/false, strings are text, etc.

label => 'string'

Overrides the normal name/description rules for the option label in the GUI.

choices => [ 'choices', ... ]

Reference to an array of the choices for a radio option.

width => number

The number of pixels for input widgets for which a width might make sense (string, integer, etc). These widgets normally exapnd with the enclosing window, setting a width overrides this behavior.

joiner => 'string'

How to join the option name to the option value. Default for short (single-letter) options is a space, and for long options is an equals sign.

widget => object

Used by the GUI wrapper to store a pointer to the widget for this option.

retriever => coderef

Used by the GUI wrapper to store a reference to a subroutine that can read back the value of the option widget.

SEE ALSO

CLI::Gwrap

AUTHOR

Reid Augustin <reid@hellosix.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Reid Augustin.

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