Documentation ¶
Overview ¶
Package tool contains various helper utilitites useful for implementation of command line tools.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FuzzParseFlags ¶
func Init ¶
func Init() func()
Init handles common tasks for command line tools:
- invokes flag.Parse
- adds support for optional flags (see OptionalFlags)
- adds support for cpu/mem profiling (-cpuprofile/memprofile flags)
Use as defer tool.Init()().
func OptionalFlags ¶
OptionalFlags produces command line flag value that encapsulates the given flags as optional. This is intended for programmatic use only when we invoke older versions of binaries with new unsupported flags. Use tool.Init to support optional flags in the binary. The format keeps flags reasonably readable ("-optional=foo=bar:baz=123"), not subject to accidental splitting into multiple arguments due to spaces and supports bool/non-bool flags.
Types ¶
Click to show internal directories.
Click to hide internal directories.