arg

package
v1.11.13 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 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

CleanOpts returns a string of sorted options.

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

Targets are the file sections to clean.

Types

type APIs

type APIs struct {
	Refresh bool // Refresh empty fields in the database with data from the API.
	Pouet   bool // Pouet sync local files with pouet ids linked on demozoo.
	SyncDos bool // SyncDos scan demozoo for missing local msdos bbstros and cracktros.
	SyncWin bool // SyncWin scan demozoo for missing local windows bbstros and cracktros.
}

APIs synchronization flags.

type Approve

type Approve struct {
	Verbose bool // Verbose display the records that are being approved.
}

Approve records flags.

type Clean

type Clean struct {
	Delete   bool   // Delete erase the orphan files.
	Humanise bool   // Humanise display the file sizes in human readable format.
	MakeDirs bool   // MakeDirs generate uuid directories.
	Target   string // Target is the type of file to clean.
}

Clean orphan file flags.

type Demozoo

type Demozoo struct {
	All       bool     // All scans all demozoo records.
	Overwrite bool     // Overwrite all existing assets.
	New       bool     // New scans for new demozoo submissions.
	ID        string   // ID auto-generated id or a uuid.
	Extract   []string // Extracts and parses an archived file.
	Ping      uint     // Ping fetches and displays the demozoo api response.
	Download  uint     // Download fetches and saves the demozoo api response.
	Releaser  uint     // Releaser add to the local files all the productions of a demozoo scener.
}

Demozoo synchronization flags.

type Env added in v1.11.3

type Env struct {
	Init bool // Init creates the configuration directories.
}

Env flags.

type Group

type Group struct {
	Counts   bool   // Counts display the file totals for each group.
	Cronjob  bool   // Cronjob run the group command as a cronjob.
	Forcejob bool   // Forcejob run the group command as a cronjob ignoring any conditions.
	Init     bool   // Init displays the acronyms and initalialisms for each group.
	Progress bool   // Progress display the progress bar.
	Filter   string // Filter groups by tags.
	Format   string // Format the output.
}

Group flags.

type Import

type Import struct {
	Insert bool // Insert the found text files metadata into the database.
	Limit  uint // Limit the number of found text files to import.
}

Import flags.

type People

type People struct {
	Cronjob  bool   // Cronjob run the people command as a cronjob.
	Forcejob bool   // Forcejob run the people command as a cronjob ignoring any conditions.
	Progress bool   // Progress display the progress bar.
	Filter   string // Filter people by roles.
	Format   string // Format the output.
}

People flags.

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 // ID or uuid of a single proof.
	All         bool   // All scans for all proofs, not just new uploads.
	HideMissing bool   // HideMissing hide proofs that are missing their file download.
	Overwrite   bool   // Overwrite all existing images.
}

Prods flags.

type Recent

type Recent struct {
	Compress bool // Compress removes insignificant whitespace characters from the output.
	Limit    uint // Limit the number of recent records to display.
}

Recent flags.

type TestSite

type TestSite struct {
	LocalHost bool // LocalHost runs the tests to target a developer, Docker setup.
}

TestSite flags.

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.
}

ZipCmmt flags.

Jump to

Keyboard shortcuts

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