flagutil

package
v0.0.0-...-c39e8e5 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: AGPL-3.0 Imports: 1 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseArgs

func ParseArgs(s *flag.FlagSet, args []string) []string

ParseArgs parses the args using the given FlagSet, and returns the parsed args that does not include flags.

Types

type FlagFactory

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

FlagFactory is a factory that can be used to create flag sets.

func NewFactory

func NewFactory(name string) *FlagFactory

NewFactory creates a new flag factory with the given name.

func (*FlagFactory) New

func (f *FlagFactory) New() *FlagSet

New creates a new flag set.

func (*FlagFactory) PlainArgs

func (f *FlagFactory) PlainArgs(args []string) []string

PlainArgs parse the args with no flags.

type FlagSet

type FlagSet struct {
	*flag.FlagSet
}

FlagSet extends the *flag.FlagSet with some more common helper functions.

func (*FlagSet) ParseArgs

func (s *FlagSet) ParseArgs(args []string) []string

ParseArgs parses the args and returns the parsed args that does not include flags.

Jump to

Keyboard shortcuts

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