cli

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package cli provides error constructors for generic CLI input validation such as missing flags, arguments, and invalid selections.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArgRequired

func ArgRequired(name string) error

ArgRequired returns an error for a missing required argument.

Parameters:

  • name: the argument name

Returns:

  • error: "<name> argument is required"

func FlagRequired

func FlagRequired(name string) error

FlagRequired returns an error for a missing required flag.

Parameters:

  • name: the flag name

Returns:

  • error: "required flag \"<name>\" not set"

func InvalidSelection

func InvalidSelection(input string, max int) error

InvalidSelection returns an error for an invalid interactive selection.

Parameters:

  • input: the user's input
  • max: the maximum valid selection number

Returns:

  • error: "invalid selection: <input> (expected 1-<max>)"

func UnknownDocument

func UnknownDocument(alias string) error

UnknownDocument returns an error for an unrecognized document alias.

Parameters:

  • alias: the unrecognized alias

Returns:

  • error: "unknown document <alias> (available: manifesto, about, invariants)"

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL