cli

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: GPL-3.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFlagsFromObject added in v0.7.0

func AddFlagsFromObject(object any, cmd *Cli)

AddFlagsFromObject adds flags from an object if it satisfies FlagAdder.

func ValString added in v0.3.0

func ValString(input string) error

ValString is a validation function that always returns nil, accepting any string.

Types

type Cli

type Cli = cli.Cli
var Default *Cli

Default is the default command line. When this package is imported, calling aj.Run will populate this Cli with information about the application and enable command line capabilities for it. An application may implement FlagAdder to add flags to it before it is parsed.

Even if applications do not use aj.Run, they should prefer using this variable so that all flags can be collected in one place. Importantly, if you do this, remember to call the Parse or ParseOrExit methods, as those are normally called by the run function.

type Flag

type Flag = cli.Flag

type FlagAdder added in v0.2.0

type FlagAdder interface {
	AddFlags(*Cli)
}

FlagAdder is an object that wants to collect command line arguments.

Source Files

  • cli.go

Jump to

Keyboard shortcuts

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