Documentation
¶
Overview ¶
Package testverbhelp is the per-tool check of the verb-help rule (the CLI style's rule (b), #4505; internal/nsprint/verbflag is the one seam that implements it): `<tool> <verb> -h` and `--help` print that verb's help on stdout and exit 0, with nothing on stderr, no file written and no dial. The check opens no socket: it is a unit-tier check.
Each tool's test names its verbs and, for each, the flags that would point the verb at a place: a path flag gets {dir}/..., a store address gets {addr}. They are given BEFORE -h, so the parser has taken them when it meets -h, and the check then holds that nothing was created under {dir}. {addr} is RefusedAddr, a loopback port nothing listens on: the check owns no socket, and a verb that dials before it answers -h meets a refusal and fails the exit, stderr or budget clause.
Index ¶
Constants ¶
const Budget = 50 * time.Millisecond
Budget is how long help may take. Help is a print; anything that took longer than this dialed, waited or walked something.
const RefusedAddr = "127.0.0.1:1"
RefusedAddr is what {addr} becomes: loopback port 1, where nothing listens, so a dial is refused at once and the check needs no listener of its own.
Variables ¶
This section is empty.
Functions ¶
func HelpVerb ¶
HelpVerb checks `<tool> help <verb>` for a tool whose help verb takes one: the same help `<verb> -h` prints, on stdout, at exit 0, nothing on stderr.