pflags

package module
v0.0.0-...-e60c1d0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: MIT Imports: 4 Imported by: 0

README ¶

pflags

🚧 PACKAGE STILL IN DEVELOPMENT, HERE BE DRAGONS! 🚧

a minimal command line flag parser that aimsto implement a POSIX getopt-like interface for the Go programming language. Go's standard library flag package deviates from this and other similar standards (such as getopts) in favor of a parsing pattern that was an intentional deviation from the POSIX-style parsing by the Go team. This package aims to provide an extremely minimal, dependency-free flag parsing implementation that can replace the flag package in the standard library for those who wish to parse command line flags with a more traditional POSIX-style compliance that most engineers would be accustomed to when using command-line applications.

Documentation ¶

Index ¶

Constants ¶

View Source
const (
	LONG = iota
	SHORT
)

Variables ¶

This section is empty.

Functions ¶

func NewFlag ¶

func NewFlag[T flagTypeUnion](
	fg *FlagSet,
	ptr *T,
	short, long, help string,
	fallback T,
) error

Types ¶

type FlagSet ¶

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

func DefaultFlagSet ¶

func DefaultFlagSet() FlagSet

func NewFlagSet ¶

func NewFlagSet(flags flagValsMap, args []string) FlagSet

func (*FlagSet) Parse ¶

func (fg *FlagSet) Parse()

Jump to

Keyboard shortcuts

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