extflag

package
v0.19.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 License: Apache-2.0 Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FlagClause added in v0.16.0

type FlagClause interface {
	Flag(name, help string) *kingpin.FlagClause
}

func HiddenCmdClause added in v0.13.0

func HiddenCmdClause(c FlagClause) FlagClause

HiddenCmdClause returns FlagClause that hides created flags.

type PathOrContent

type PathOrContent struct {
	// contains filtered or unexported fields
}

PathOrContent is a flag type that defines two flags to fetch bytes. Either from file (*-file flag) or content (* flag).

func RegisterPathOrContent

func RegisterPathOrContent(cmd FlagClause, flagName string, help string, required bool) *PathOrContent

RegisterPathOrContent registers PathOrContent flag in kingpinCmdClause.

func (*PathOrContent) Content

func (p *PathOrContent) Content() ([]byte, error)

Content returns the content of the file when given or directly the content that has passed to the flag. Flag that specifies path has priority. It returns error if the content is empty and required flag is set to true.

Jump to

Keyboard shortcuts

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