Steve Price > App-Framework-1.06 > App::Framework::Core::Script

Download:
App-Framework-1.06.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 1.003   Source  

NAME ^

App::Framework::Core::Script - App::Framework command line script personality

SYNOPSIS ^

  # Script is loaded by default as if the script contained:
  use App::Framework ':Script' ;

DESCRIPTION ^

This personality implements a standard command line script.

DOCUMENTATION TO BE COMPLETED

Derived object from App::Framework::Core. Should only be called via App::Framework import.

Adds command line script specific additions to base properties. Adds the following additional options:

        'v|"verbose"'           Make script output more verbose
        'dryrun|"norun"'        Do not execute anything that would alter the file system, just show the commands that would have executed

Defines the exit() method which just calls standard exit.

Defines a usage_fn which gets called by App::Framework::Core->uage(). This function calls pod2usage to display help, man page etc.

FIELDS

None

CONSTRUCTOR METHODS

new([%args])

Create a new App::Framework::Script.

The %args are specified as they would be in the set method, for example:

        'mmap_handler' => $mmap_handler

The full list of possible arguments are :

        'fields'        => Either ARRAY list of valid field names, or HASH of field names with default values 

CLASS METHODS

allowed_class_instance()

Class instance object is not allowed

OBJECT METHODS

exit()

Exit the application.

catch_error($error)

Function that gets called on errors. $error is as defined in App::Framework::Base::Object::ErrorHandle

script_usage($level)

Show usage.

$level is a string containg the level of usage to display

        'opt' is equivalent to pod2usage(2)

        'help' is equivalent to pod2usage(1)

        'man' is equivalent to pod2usage(-verbose => 2)

DIAGNOSTICS ^

Setting the debug flag to level 1 prints out (to STDOUT) some debug messages, setting it to level 2 prints out more verbose messages.

AUTHOR ^

Steve Price <sdprice at cpan.org>

BUGS ^

None that I know of!

syntax highlighting: