The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Name

Class::Usul::TraitFor::Usage - Help and diagnostic information for command line programs

Synopsis

   use Moo;

   extends 'Class::Usul';
   with    'Class::Usul::TraitFor::Usage';

Description

Help and diagnostic information for command line programs

Configuration and Environment

Defines the following attributes;

encoding

Decode/encode input/output using this encoding

H help_manual

Print long help text extracted from this POD

h help_options

Print short help text extracted from this POD

? help_usage

Print option usage

V show_version

Prints the programs version number and exits

Requires the following;

config
dumper
next_argv
options_usage
output
quiet

Subroutines/Methods

dump_config_attr - Dumps the configuration attributes and values

Visits the configuration object, forcing evaluation of the lazy, and printing out the attributes and values

dump_self - Dumps the program object

Dumps out the self referential object using Data::Printer

help - Display help text about a method

Searches the programs classes and roles to find the method implementation. Displays help text from the POD that describes the method

list_methods - Lists available command line methods

Lists the methods (marked by the method subroutine attribute) that can be called via the run method

app_version

   $version_object = $self->app_version;

The version number of the configured application class

BUILD

Called just after the object is constructed this method handles dispatching to the help methods

can_call

   $bool = $self->can_call( $method );

Returns true if $self has a method given by $method that has defined the method method attribute

exit_usage

   $self->exit_usage( $verbosity );

Print out usage information from POD. The $verbosity is; 0, 1 or 2

exit_version

   $self->exit_version;

Prints out the version of the C::U::Programs subclass and the exits

Diagnostics

None

Dependencies

attributes
Class::Inspector
Class::Usul::IPC
Class::Usul::File
Class::Usul::Options
Moo::Role

Incompatibilities

There are no known incompatibilities in this module

Bugs and Limitations

There are no known bugs in this module. Please report problems to http://rt.cpan.org/NoAuth/Bugs.html?Dist=Class-Usul. Patches are welcome

Acknowledgements

Larry Wall - For the Perl programming language

Author

Peter Flanigan, <pjfl@cpan.org>

License and Copyright

Copyright (c) 2017 Peter Flanigan. All rights reserved

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

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