NAME

Term::CLI::Base - generic base class for Term::CLI classes

VERSION

version 0.054001

SYNOPSIS

package Term::CLI::Something {

   use Moo;

   extends 'Term::CLI::Base';

   ...
};

DESCRIPTION

Generic base class for Term::CLI(3p) classes. This class provides some basic functions and attributes that all classes except Term::CLI::ReadLine share.

METHODS

Accessors

name

Element name. Can be any string, but must be specified at construction time.

error

Contains a diagnostic message in case of errors.

term

The active Term::CLI::ReadLine object.

Others

set_error ( STRING, ... )

Sets the error() attribute to the concatenation of all STRING parameters. If no arguments are given, or the first argument is undef, the error field is cleared (see set_error below).

Always returns a "failure" (undef or the empty list, depending on call context).

clear_error

Set the error() attribute to the empty string and return 1.

SEE ALSO

Term::CLI(3p), Term::CLI::Element(3p), Term::CLI::ReadLine(3p).

AUTHOR

Steven Bakker <sbakker@cpan.org>, 2018.

COPYRIGHT AND LICENSE

Copyright (c) 2018 Steven Bakker

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See "perldoc perlartistic."

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.