arg

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package arg has structures used to store the flag values used by the cobra.Command methods.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFlagValue = errors.New("value for flag is not valid")
	ErrNoCmd     = errors.New("no command argument was provided")
)

Functions

func CleanOpts

func CleanOpts(a ...string) string

func FilterFlag

func FilterFlag(w io.Writer, t any, flag, val string) error

FilterFlag compairs the value of the filter flag against the list of slice values.

func Invalid

func Invalid(w io.Writer, arg string, args ...string) error

Invalid returns instructions for invalid command arguments and exits with an error code.

func Targets

func Targets() []string

Types

type APIs

type APIs struct {
	Refresh bool
	Pouet   bool
	SyncDos bool
	SyncWin bool
}

type Approve

type Approve struct {
	Verbose bool
}

type Clean

type Clean struct {
	Delete   bool
	Humanise bool
	MakeDirs bool
	Target   string
}

type Config

type Config struct {
	InfoSize  bool
	Name      string
	Overwrite bool
}

type Demozoo

type Demozoo struct {
	All       bool // scan for all proofs, not just new submissions
	Overwrite bool // overwrite all existing assets
	New       bool
	ID        string // auto-generated id or a uuid
	Extract   []string
	Ping      uint
	Download  uint
	Releaser  uint // id for a releaser
}

type Group

type Group struct {
	Counts   bool
	Cronjob  bool
	Forcejob bool
	Init     bool
	Progress bool
	Filter   string
	Format   string
}

type Import

type Import struct {
	Insert bool
	Limit  uint
}

type People

type People struct {
	Cronjob  bool
	Forcejob bool
	Progress bool
	Filter   string
	Format   string
}

type Persistent

type Persistent struct {
	Panic   bool // Enable panic errors to help debug.
	ASCII   bool // Ascii is placeholder for Cobra to store the PersistentFlag value*
	Quiet   bool // Quiet is placeholder for Cobra to store the PersistentFlag value*
	Version bool // Version is placeholder for Cobra to store the PersistentFlag value*

}

Persistent global flags.

type Proof

type Proof struct {
	ID          string // auto-generated id or a uuid
	All         bool   // scan for all proofs, not just new uploads
	HideMissing bool   // hide proofs that are missing their file download
	Overwrite   bool   // overwrite all existing images
}

type Recent

type Recent struct {
	Compress bool
	Limit    uint
}

type TestSite

type TestSite struct {
	LocalHost bool
}

type ZipCmmt

type ZipCmmt struct {
	Stdout  bool // Stdout writes any found zip comment to the stdout.
	Unicode bool // Unicode attempts to convert any CP-437 encoded comments to Unicode.
	OW      bool // OW overwrites any existing save zip comments, otherwise they're skipped.
}

Jump to

Keyboard shortcuts

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