flagset

package
v0.0.0-...-94a580d Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package flagset contains of core shared functions that every cli command needs for parsing flags

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(fs *flag.FlagSet, f *flag.Flag) bool

Contains returns true if the given flag is contained in the given flag set or false otherwise.

func Merge

func Merge(dst, src *flag.FlagSet)

func PrintFlag

func PrintFlag(w io.Writer, f *flag.Flag)

PrintFlag prints a single flag to the given writer.

func PrintTitle

func PrintTitle(w io.Writer, s string)

PrintTitle prints a consistently-formatted title to the given writer.

func WrapAtLength

func WrapAtLength(s string, pad int) string

WrapAtLength wraps the given text at the maxLineLength, taking into account any provided left padding.

Types

type FlagSet

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

func New

func New(name string, usage string) *FlagSet

func (*FlagSet) Merge

func (fs *FlagSet) Merge(input *flag.FlagSet)

func (*FlagSet) Usage

func (fs *FlagSet) Usage() string

func (*FlagSet) Value

func (fs *FlagSet) Value() *flag.FlagSet

func (*FlagSet) Var

func (fs *FlagSet) Var(value flag.Value, name string, usage string)

Jump to

Keyboard shortcuts

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