package
1.13.7
Repository: https://github.com/starudream/go-lib.git
Documentation: pkg.go.dev

# Functions

AddTemplateFunc adds a template function that's available to Usage and Help template generation.
AddTemplateFuncs adds multiple template functions that are available to Usage and Help template generation.
AppendActiveHelp adds the specified string to the specified array to be used as ActiveHelp.
ArbitraryArgs never returns an error.
CheckErr prints the msg with the prefix 'Error:' and exits with error code 1.
CompDebug prints the specified string to the same file as where the completion script prints its logs.
CompDebugln prints the specified string with a newline at the end to the same file as where the completion script prints its logs.
CompError prints the specified completion message to stderr.
CompErrorln prints the specified completion message to stderr with a newline at the end.
Eq takes two types and checks whether they are equal.
ExactArgs returns an error if there are not exactly n args.
FixedCompletions can be used to create a completion function which always returns the same results.
GetActiveHelpConfig returns the value of the ActiveHelp environment variable <PROGRAM>_ACTIVE_HELP where <PROGRAM> is the name of the root command in upper case, with all - replaced by _.
Gt takes two types and checks whether the first type is greater than the second.
MarkFlagCustom adds the BashCompCustom annotation to the named flag, if it exists.
MarkFlagDirname instructs the various shell completion implementations to limit completions for the named flag to directory names.
MarkFlagFilename instructs the various shell completion implementations to limit completions for the named flag to the specified file extensions.
MarkFlagRequired instructs the various shell completion implementations to prioritize the named flag when performing completion, and causes your command to report an error if invoked without the flag.
MatchAll allows combining several PositionalArgs to work in concert.
MaximumNArgs returns an error if there are more than N args.
MinimumNArgs returns an error if there is not at least N args.
NoArgs returns an error if any args are included.
NoFileCompletions can be used to disable file completion for commands that should not trigger file completions.
OnFinalize sets the passed functions to be run when each command's Execute method is terminated.
OnInitialize sets the passed functions to be run when each command's Execute method is called.
OnlyValidArgs returns an error if there are any positional args that are not in the `ValidArgs` field of `Command`.
RangeArgs returns an error if the number of args is not within the expected range.
WriteStringAndCheck writes a string into a buffer, and checks if the error is not nil.

# Constants

Annotations for Bash completion.
Annotations for Bash completion.
Annotations for Bash completion.
Annotations for Bash completion.
No description provided by the author
ShellCompDirectiveDefault indicates to let the shell perform its default behavior after completions have been provided.
ShellCompDirectiveError indicates an error occurred and completions should be ignored.
ShellCompDirectiveFilterDirs indicates that only directory names should be provided in file completion.
ShellCompDirectiveFilterFileExt indicates that the provided completions should be used as file extension filters.
ShellCompDirectiveKeepOrder indicates that the shell should preserve the order in which the completions are provided.
ShellCompDirectiveNoFileComp indicates that the shell should not provide file completion even when no completion is provided.
ShellCompDirectiveNoSpace indicates that the shell should not add a space after the completion even if there is a single completion provided.
ShellCompNoDescRequestCmd is the name of the hidden command that is used to request completion results without their description.
ShellCompRequestCmd is the name of the hidden command that is used to request completion results from the program.

# Variables

EnableCaseInsensitive allows case-insensitive commands names.
EnableCommandSorting controls sorting of the slice of commands, which is turned on by default.
EnablePrefixMatching allows to set automatic prefix matching.
MousetrapDisplayDuration controls how long the MousetrapHelpText message is displayed on Windows if the CLI is started from explorer.exe.
MousetrapHelpText enables an information splash screen on Windows if the CLI is started from explorer.exe.

# Structs

Command is just that, a command for your application.
CompletionOptions are the options to control shell completion.
Group Structure to manage groups for commands.

# Type aliases

FParseErrWhitelist configures Flag parse errors to be ignored.
No description provided by the author
ShellCompDirective is a bit map representing the different behaviors the shell can be instructed to have once completions have been provided.