Documentation
¶
Overview ¶
Package phelp provides the standard help parameter handling which includes printing the standard help message and any error reporting. It is not anticipated that any of the interfaces will be called directly.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommonParamsGroupNamePrefix ¶ added in v4.1.0
func CommonParamsGroupNamePrefix() string
CommonParamsGroupNamePrefix returns the prefix used to start the names of all the common parameter groups
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 NewStdHelp ¶
func NewStdHelp() *StdHelp
NewStdHelp returns a pointer to a well-constructed instance of the standard help type ready to be used as the helper for a new param.PSet (the standard paramset.New() function will use this)
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 any messages and then a standardised usage message based on the parameters supplied to the param set. If it is called directly (that is if the help style is set to noHelp) then the output will be written to the param.PSet's error writer (by default stderr) rather than to its standard writer (stdout) and os.Exit will be called with an exit status of 1 to indicate an error.
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.