Documentation
¶
Overview ¶
Package helpcolours adds clap-style colourised --help output to CLIs built with github.com/alecthomas/kong. Wire it in with:
kong.Parse(&cli,
kong.Help(helpcolours.Help),
kong.ShortHelp(helpcolours.ShortHelp), // optional
)
Colour is enabled when stdout is a terminal (or FORCE_COLOR is set) and NO_COLOR is unset.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Help kong.HelpPrinter = func(options kong.HelpOptions, ctx *kong.Context) error { return printWithColour(options, ctx, kong.DefaultHelpPrinter) }
Help is a kong.HelpPrinter that delegates to kong.DefaultHelpPrinter and post-processes the output to inject ANSI colour codes when colour is enabled for ctx.Stdout.
var ShortHelp kong.HelpPrinter = func(options kong.HelpOptions, ctx *kong.Context) error { return printWithColour(options, ctx, kong.DefaultShortHelpPrinter) }
ShortHelp is the equivalent wrapper around kong.DefaultShortHelpPrinter, for use with kong.ShortHelp(...). Kong invokes the short-help printer when a parse error occurs, to print a one-line usage summary plus a "Run 'foo --help' for more information." pointer.
Functions ¶
This section is empty.
Types ¶
This section is empty.