\Horde_Argv_HelpFormatter

Provides HelpFormatter, used by Horde_Argv_Parser to generate formatted help text.

Abstract base class for formatting option help. Horde_Argv_Parser instances should use one of the HelpFormatter subclasses for formatting help; by default IndentedHelpFormatter is used.

Instance attributes: parser : Horde_Argv_Parser the controlling Horde_Argv_Parser instance _color : Horde_Cli_Color @since Horde_Argv 2.1.0 a color formatter indent_increment : int the number of columns to indent per nesting level max_help_position : int the maximum starting column for option help text help_position : int the calculated starting column for option help text; initially the same as the maximum width : int total number of columns for output (automatically detected by default) level : int current indentation level current_indent : int current indentation level (in columns) help_width : int number of columns available for option help text (calculated) default_tag : str text to replace with each option's default value, "%default" by default. Set to false value to disable default value expansion. option_strings : { Option : str } maps Option instances to the snippet of help text explaining the syntax of that option, e.g. "-h, --help" or "-fFILE, --file=FILE" _short_opt_fmt : str format string controlling how short options with values are printed in help text. Must be either "%s%s" ("-fFILE") or "%s %s" ("-f FILE"), because those are the two syntaxes that Horde_Argv supports. _long_opt_fmt : str similar but for long options; must be either "%s %s" ("--file FILE") or "%s=%s" ("--file=FILE").

Summary

Methods
Properties
Constants
__construct()
setParser()
setShortOptDelimiter()
setLongOptDelimiter()
indent()
dedent()
formatUsage()
formatHeading()
highlightHeading()
formatDescription()
formatEpilog()
expandDefault()
formatOption()
highlightOption()
storeOptionStrings()
formatOptionStrings()
$parser
NO_DEFAULT_VALUE
_formatText()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

NO_DEFAULT_VALUE

NO_DEFAULT_VALUE

Properties

$parser

$parser : 

Type

Methods

__construct()

__construct(  $indent_increment,   $max_help_position,   $width = null,   $short_first = false,   $color = null) 

Parameters

$indent_increment
$max_help_position
$width
$short_first
$color

setParser()

setParser(  $parser) 

Parameters

$parser

setShortOptDelimiter()

setShortOptDelimiter(  $delim) 

Parameters

$delim

setLongOptDelimiter()

setLongOptDelimiter(  $delim) 

Parameters

$delim

indent()

indent() 

dedent()

dedent() 

formatUsage()

formatUsage(  $usage) 

Parameters

$usage

formatHeading()

formatHeading(  $heading) 

Parameters

$heading

highlightHeading()

highlightHeading(string  $heading) 

Highlights with the heading color.

Parameters

string $heading

A heading text.

formatDescription()

formatDescription(  $description) 

Parameters

$description

formatEpilog()

formatEpilog(  $epilog) 

Parameters

$epilog

expandDefault()

expandDefault(  $option) 

Parameters

$option

formatOption()

formatOption(  $option) 

The help for each option consists of two parts: * the opt strings and metavars eg. ("-x", or "-fFILENAME, --file=FILENAME") * the user-supplied help string eg. ("turn on expert mode", "read data from FILENAME")

If possible, we write both of these on the same line: -x turn on expert mode

But if the opt string list is too long, we put the help string on a second line, indented to the same column it would start in if it fit on the first line. -fFILENAME, --file=FILENAME read data from FILENAME

Parameters

$option

highlightOption()

highlightOption(string  $option) 

Highlights with the option color.

Parameters

string $option

An option text.

storeOptionStrings()

storeOptionStrings(  $parser) 

Parameters

$parser

formatOptionStrings()

formatOptionStrings(  $option) 

Return a comma-separated list of option strings & metavariables.

Parameters

$option

_formatText()

_formatText(  $text) 

Format a paragraph of free-form text for inclusion in the help output at the current indentation level.

Parameters

$text