cli

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2025 License: MIT Imports: 11 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
	ExtraArgs []string

	Cfg config.Config

	AWSSigv4   *aws.Config
	Basic      *core.KeyVal
	Bearer     string
	BuildInfo  bool
	Complete   string
	ConfigPath string
	Data       io.Reader
	DryRun     bool
	Edit       bool
	Form       []core.KeyVal
	Help       bool
	JSON       io.Reader
	Method     string
	Multipart  []core.KeyVal
	Output     string
	OutputDir  bool
	Range      []string
	UnixSocket string
	Update     bool
	Version    bool
	XML        io.Reader
}

App represents the full configuration for a fetch invocation.

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 *core.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      []core.KeyVal
	HideValues  bool
	IsHidden    bool
	IsSet       func() bool
	OS          []string
	Fn          func(value string) error
}

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 *core.Printer)

Jump to

Keyboard shortcuts

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