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

Class: CodeGen_Tools_Getopt

Source Location: /CodeGen-1.0.7/CodeGen/Tools/Getopt.php

Class Overview

Console_Getopt
   |
   --CodeGen_Tools_Getopt

A more convenient command line argument parser class


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2005-2008 Hartmut Holzgraefe

Methods


Inherited Variables

Inherited Methods


Class Details

[line 38]
A more convenient command line argument parser class


[ Top ]


Method Detail

__construct (Constructor)   [line 57]

CodeGen_Tools_Getopt __construct( string $short_options, [array $long_options = null], [callback $usage = null])

Constructor will parse specified short and long arguments
  • Access: public

Parameters:

string   $short_options     short options specification
array   $long_options     long options specification
callback   $usage     error callback, call this and exit on errors if given

[ Top ]

arguments   [line 205]

array arguments( )

Get all additional arguments not bound to options
  • Return: an array of argument string values
  • Access: public

[ Top ]

have   [line 78]

bool have( string $name, ... 1)

Check if any of the specified options was given
  • Return: true if anything found else false
  • Access: public

Parameters:

...   1     
string   $name     a short or long option name

[ Top ]

haveAll   [line 117]

bool haveAll( string $name, ... 1)

Check if all of the specified options were given
  • Return: true if all found else false
  • Access: public

Parameters:

...   1     
string   $name     a short or long option name

[ Top ]

options   [line 189]

array options( )

Get all given option names
  • Return: an array of option names
  • Access: public

[ Top ]

value   [line 158]

string value( string $name, [ $name2 = false])

Get argument value for an option
  • Return: option value or true for options without argument
  • Access: public

Parameters:

string   $name     
   $name2     

[ Top ]


Documentation generated on Mon, 27 Sep 2010 12:00:06 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.