cli

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	URL *url.URL

	AWSSigv4     *aws.Config
	Basic        *vars.KeyVal
	Bearer       string
	Color        printer.Color
	Data         io.Reader
	DNSServer    string
	DryRun       bool
	Edit         bool
	Form         []vars.KeyVal
	Format       fetch.Format
	Headers      []vars.KeyVal
	Help         bool
	HTTP         client.HTTPVersion
	IgnoreStatus bool
	Insecure     bool
	JSON         bool
	Method       string
	Multipart    []vars.KeyVal
	NoEncode     bool
	NoPager      bool
	Output       string
	Proxy        *url.URL
	QueryParams  []vars.KeyVal
	Silent       bool
	Timeout      time.Duration
	TLS          uint16
	Update       bool
	Verbose      int
	Version      bool
	XML          bool
}

func NewApp

func NewApp() *App

func Parse

func Parse(args []string) (*App, error)

func (*App) CLI

func (a *App) CLI() *CLI

func (*App) PrintHelp added in v0.4.1

func (a *App) PrintHelp(p *printer.Printer)

type Arguments

type Arguments struct {
	Name        string
	Description string
}

type CLI

type CLI struct {
	Description    string
	ArgFn          func(s string) error
	Args           []Arguments
	Flags          []Flag
	ExclusiveFlags [][]string
}

type Flag

type Flag struct {
	Short       string
	Long        string
	Aliases     []string
	Args        string
	Description string
	Default     string
	Values      []string
	IsSecret    bool
	IsSet       func() bool
	Fn          func(value string) error
}

type FlagValueError added in v0.6.0

type FlagValueError struct {
	Flag  string
	Value string
	Usage string
}

func (*FlagValueError) Error added in v0.6.0

func (err *FlagValueError) Error() string

func (*FlagValueError) PrintTo added in v0.6.0

func (err *FlagValueError) PrintTo(p *printer.Printer)

type MissingEnvVarError added in v0.6.0

type MissingEnvVarError struct {
	EnvVar string
	Flag   string
}

func (*MissingEnvVarError) Error added in v0.6.0

func (err *MissingEnvVarError) Error() string

func (*MissingEnvVarError) PrintTo added in v0.6.0

func (err *MissingEnvVarError) PrintTo(p *printer.Printer)

Jump to

Keyboard shortcuts

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