Documentation
¶
Overview ¶
Package phelp provides the standard help parameter handling which includes printing the standard help message and any error reporting.
Index ¶
Constants ¶
const ( Std helpStyle = iota Short GroupNamesOnly )
helpStyle values can be one of:
Std meaning that the standard help message is generated Full meaning that a more complete message is generated Short meaning that a concise message is generated GroupNamesOnly meaning that only group names should be shown
Variables ¶
var SH = StdHelp{ // contains filtered or unexported fields }
SH is the instance of the standard help type
Functions ¶
Types ¶
type StdHelp ¶
type StdHelp struct {
// contains filtered or unexported fields
}
StdHelp implements the Helper interface. It adds the standard arguments and processes them. This is the helper you are most likely to want and it is the one that is used by the paramset.New func.
func (StdHelp) ErrorHandler ¶
ErrorHandler will, by default, check for errors and if there are any report them and exit. It will respect the flags for controlling reporting of errors and exiting; these flags can be set by means of standard arguments as added by the StdHelp AddParams method, see the standard help message for details. It is typically called from the Parse(...) method being passed the PSet error writer, the program name and the PSet error map
func (StdHelp) Help ¶
Help prints the messages and then a standardised usage message based on the parameters supplied to the param set. It then exits with an exit status of 1
func (StdHelp) ProcessArgs ¶
ProcessArgs will process the values set after parsing is complete. This is where any StdHelp parameters (as added by the StdHelp AddParams method) will be processed.