<<

NAME

Koha::Script::Usage - Usage object returned by Koha::Script->describe_options

SYNOPSIS

    my ( $opt, $usage ) = Koha::Script->describe_options( ... );
    $usage->die( { pre_text => "Something is wrong.\n\n" } );

DESCRIPTION

A Getopt::Long::Descriptive::Usage whose die makes the script exit with status 1, like pod2usage(1) did, instead of whatever $! happens to be (see "die" in perlfunc).

API

Class methods

die

    $usage->die( { pre_text => "...", post_text => "..." } );

Dies with the usage text, as "die" in Getopt::Long::Descriptive::Usage does. If the exception is not caught, the script exits with status 1.

set_exit_status

    Koha::Script::Usage::set_exit_status();
    die $message;

Makes the next uncaught die exit with status 1. Perl uses $! as the exit status if it is not 0, then $? 8 >>.

<<