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 ¶
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 records the parameter values set by the common parameters and proivides methods for generating the help message. This is the helper you should use unless you are testing the package or have some requirement to provide help other than at the command line.
It will be used automatically if you create your param.PSet using the paramset.New function (recommended).
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.
Source Files ¶
- addNotes.go
- addParams.go
- addParamsCompletion.go
- addParamsHelp.go
- addParamsParams.go
- configFileSetter.go
- doc.go
- errorHandler.go
- examples.go
- help.go
- helpWidthSetterUnix.go
- intro.go
- markdown.go
- notes.go
- paramGroupSections.go
- paramSources.go
- processArgs.go
- references.go
- setConfigFileForGroupStdParamsCmpl.go
- stdHelp.go
- unusedParams.go
- usageSummary.go
- whereSet.go
- zshCompletions.go