Documentation
¶
Overview ¶
Package shared defines the small contracts used by independent CLI families. It does not construct commands or perform domain operations.
Index ¶
- Constants
- Variables
- func AddJSONFormatFlags(command *cobra.Command, jsonOut *bool)
- func ArgumentOrCurrent(args []string) string
- func HumanAge(d time.Duration) string
- func OutputFormatChanged(command *cobra.Command) bool
- func PublishedAgo(value string) string
- func RequireOutputFormat(value string, allowed ...string) error
- func SelectJSONFormat(format string, jsonOut bool) (string, error)
- func ShellQuoteArg(value string) string
- func ShortPath(path string) string
- func ValidateBranchChoice(branch string, branchChosen, prefixChosen bool) error
- func WriteFormat(writer io.Writer, format string, values ...any) error
- func WriteLine(writer io.Writer, values ...any) error
- type Flags
- type Runtime
Constants ¶
const ( ExitFindings = 1 ExitUsage = 2 )
const (
DefaultCIWaitSlice = 8 * time.Minute
)
Variables ¶
var ExactGitObjectID = regexp.MustCompile(`^[0-9a-fA-F]{40}([0-9a-fA-F]{24})?$`)
Functions ¶
func AddJSONFormatFlags ¶
AddJSONFormatFlags gives commands with a JSON output mode one canonical selector and keeps --json as an exact, order-aware shortcut. Both flags write the same value, so --json is equivalent to --format=json and --json=false is equivalent to --format=text.
func ArgumentOrCurrent ¶
func OutputFormatChanged ¶
func PublishedAgo ¶
func RequireOutputFormat ¶
RequireOutputFormat checks an exact format name and explains the accepted spellings. It preserves the CLI's existing format diagnostic.
func SelectJSONFormat ¶
SelectJSONFormat preserves the independent --format/--json selector contract.
func ShellQuoteArg ¶
func ValidateBranchChoice ¶
ValidateBranchChoice validates explicit branch choices without altering their values.
Types ¶
type Flags ¶
type Flags struct {
ProjectsRoot string
Filter string
ExtraOrgs []string
NonInteractive bool
Quiet bool
}
Flags is a snapshot of invocation-wide options. Families read only the fields they consume; the root registry remains responsible for persistent flag policy.