Console_CommandLine
[ class tree: Console_CommandLine ] [ index: Console_CommandLine ] [ all elements ]

Class: Console_CommandLine_MessageProvider_Default

Source Location: /Console_CommandLine-1.2.0/Console/CommandLine/MessageProvider/Default.php

Class Overview


Lightweight class that manages messages used by Console_CommandLine package, allowing the developper to customize these messages, for example to internationalize a command line frontend.


Author(s):

Version:

  • Release: 1.2.0

Copyright:

  • 2007 David JEAN LOUIS

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 49]
Lightweight class that manages messages used by Console_CommandLine package, allowing the developper to customize these messages, for example to internationalize a command line frontend.


[ Top ]


Class Variables

$messages = array(
        'OPTION_VALUE_REQUIRED'   => 'Option "{$name}" requires a value.',
        'OPTION_VALUE_UNEXPECTED' => 'Option "{$name}" does not expect a value (got "{$value}").',
        'OPTION_VALUE_NOT_VALID'  => 'Option "{$name}" must be one of the following: "{$choices}" (got "{$value}").',
        'ARGUMENT_VALUE_NOT_VALID'=> 'Argument "{$name}" must be one of the following: "{$choices}" (got "{$value}").',
        'OPTION_VALUE_TYPE_ERROR' => 'Option "{$name}" requires a value of type {$type} (got "{$value}").',
        'OPTION_AMBIGUOUS'        => 'Ambiguous option "{$name}", can be one of the following: {$matches}.',
        'OPTION_UNKNOWN'          => 'Unknown option "{$name}".',
        'ARGUMENT_REQUIRED'       => 'You must provide at least {$argnum} argument{$plural}.',
        'PROG_HELP_LINE'          => 'Type "{$progname} --help" to get help.',
        'PROG_VERSION_LINE'       => '{$progname} version {$version}.',
        'COMMAND_HELP_LINE'       => 'Type "{$progname} <command> --help" to get help on specific command.',
        'USAGE_WORD'              => 'Usage',
        'OPTION_WORD'             => 'Options',
        'ARGUMENT_WORD'           => 'Arguments',
        'COMMAND_WORD'            => 'Commands',
        'PASSWORD_PROMPT'         => 'Password: ',
        'PASSWORD_PROMPT_ECHO'    => 'Password (warning: will echo): ',
        'INVALID_CUSTOM_INSTANCE' => 'Instance does not implement the required interface',
        'LIST_OPTION_MESSAGE'     => 'lists valid choices for option {$name}',
        'LIST_DISPLAYED_MESSAGE'  => 'Valid choices are: ',
        'INVALID_SUBCOMMAND'      => 'Command "{$command}" is not valid.',
        'SUBCOMMAND_REQUIRED'     => 'Please enter one of the following command: {$commands}.',
    )

[line 60]

Associative array of messages
  • Access: protected

Type:   array


[ Top ]



Method Detail

get   [line 96]

string get( string $code, [array $vars = array()])

Retrieve the given string identifier corresponding message.
  • Access: public

Parameters:

string   $code     The string identifier of the message
array   $vars     An array of template variables

[ Top ]

getWithCustomMessages   [line 117]

string getWithCustomMessages( string $code, [array $vars = array()], [array $messages = array()])

Retrieve the given string identifier corresponding message.
  • Access: public

Parameters:

string   $code     The string identifier of the message
array   $vars     An array of template variables
array   $messages     An optional array of messages to use. Array indexes are message codes.

[ Top ]

replaceTemplateVars   [line 142]

string replaceTemplateVars( string $message, [array $vars = array()])

Replaces template vars in a message
  • Access: protected

Parameters:

string   $message     The message
array   $vars     An array of template variables

[ Top ]


Documentation generated on Thu, 25 Oct 2012 08:00:05 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.