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

Class: Console_Getargs_Options

Source Location: /Console_Getargs-1.3.5/Console/Getargs.php

Class Overview


This class implements a wrapper to the command line options and arguments.


Author(s):

Methods


Inherited Variables

Inherited Methods


Class Details

[line 541]
This class implements a wrapper to the command line options and arguments.


[ Top ]


Method Detail

checkRequired   [line 1106]

void checkRequired( )

checkRequired
  • Access: public

[ Top ]

getValue   [line 1057]

array|string|null getValue( string $optname)

Returns the argument of the given option

You can use the short, alias or long version of the option name. This method will try to find the argument(s) of the given option name. If it is not found it will return null. If the arg has more than one argument, an array of arguments will be returned.

  • Return: argument(s) associated with the option
  • Access: public

Parameters:

string   $optname   —  the name of the option

[ Top ]

getValues   [line 1080]

array getValues( [string $optionNames = 'long'])

Returns all arguments that have been parsed and recognized

The name of the options are stored in the keys of the array. You may choose whether you want to use the long or the short option names

  • Return: values for all options
  • Access: public

Parameters:

string   $optionNames   —  option names to use for the keys (long or short)

[ Top ]

isDefined   [line 1011]

boolean isDefined( string $optname)

Checks whether the given option is defined

An option will be defined if an argument was assigned to it using the command line options. You can use the short, the long or an alias name as parameter.

  • Return: true if the option is defined
  • Access: public

Parameters:

string   $optname   —  the name of the option to be checked

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:40:08 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.