Documentation
¶
Overview ¶
Package contract carries the two facts a refused CLI contract needs on both sides of the command boundary: the sentinel a command returns once it has printed its JSON refusal, and the exit status main gives it.
It is a package of its own, and not part of pkg/cmds/internal/utils, only because cmd/canary lives outside that internal tree and must be able to recognise the sentinel Execute hands back.
Index ¶
Constants ¶
const ExitCode = 2
ExitCode is the exit status a contract refusal uses. It is distinct from 1 so a caller can tell "canary refused because you asked for something it will not do" from "the command failed".
Variables ¶
var ErrFailed = errors.New("contract refused")
ErrFailed is the sentinel a command returns once it has already printed its contract line. main maps it to ExitCode; nothing prints it, because the JSON line on stdout is the entire message.
Functions ¶
This section is empty.
Types ¶
This section is empty.