Documentation ¶
Overview ¶
Package flagutil is a collection of helper functions for Kythe binaries using the flag package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SimpleUsage ¶
SimpleUsage returns a basic flag.Usage function that prints the given description and list of arguments in the following format:
Usage: binary <arg0> <arg1> ... <argN> <description> <build.VersionLine()> Flags: <flag.PrintDefaults()>
func UsageError ¶
func UsageError(msg string)
UsageError prints msg to stderr, calls flag.Usage, and exits the program unsuccessfully.
func UsageErrorf ¶
func UsageErrorf(str string, vals ...interface{})
UsageErrorf prints str formatted with the given vals to stderr, calls flag.Usage, and exits the program unsuccessfully.
Types ¶
type IntList ¶ added in v0.0.50
type IntList []int
IntList implements a flag.Value that accepts multiple values by repeatedly specifying the flag.
type StringList ¶ added in v0.0.31
type StringList []string
StringList implements a flag.Value that accepts an sequence of values as a CSV.
func (*StringList) Get ¶ added in v0.0.31
func (f *StringList) Get() interface{}
Get implements flag.Getter and returns a slice of string values.
func (*StringList) Set ¶ added in v0.0.31
func (f *StringList) Set(s string) error
Set implements part of the flag.Getter interface and will append new values to the flag.
func (*StringList) String ¶ added in v0.0.31
func (f *StringList) String() string
String implements part of the flag.Getter interface and returns a string-ish value for the flag.
type StringMultimap ¶ added in v0.0.31
StringMultimap implements a flag.Value that accepts an set of key-value entries as a CSV.
func (*StringMultimap) Get ¶ added in v0.0.31
func (f *StringMultimap) Get() interface{}
Get implements flag.Getter and returns a slice of string values.
func (*StringMultimap) Set ¶ added in v0.0.31
func (f *StringMultimap) Set(s string) error
Set implements part of the flag.Getter interface and will append new values to the flag.
func (*StringMultimap) String ¶ added in v0.0.31
func (f *StringMultimap) String() string
String implements part of the flag.Getter interface and returns a string-ish value for the flag.
type StringSet ¶ added in v0.0.31
StringSet implements a flag.Value that accepts an set of values as a CSV.
func (*StringSet) Elements ¶ added in v0.0.31
Elements returns the set of elements as a sorted slice.
func (*StringSet) Get ¶ added in v0.0.31
func (f *StringSet) Get() interface{}
Get implements flag.Getter and returns a slice of string values.
func (*StringSet) Set ¶ added in v0.0.31
Set implements part of the flag.Getter interface and will append new values to the flag.