Help us shape the future of Go! Take the 2026 Go Developer Survey

options

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrorVerboseAndQuiet indicates than user specified "verbose" and "quiet" flags together
	ErrorVerboseAndQuiet = errors.New(`You cannot use "verbose" and "quiet" flags together`)

	// ErrorPatchAndQuiet indicates than user specified "patch" and "quiet" flags together
	ErrorPatchAndQuiet = errors.New(`You cannot use "patch" and "quiet" flags together`)

	// ErrorVerboseAndPatch indicates than user specified "verbose" and "patch" flags together
	ErrorVerboseAndPatch = errors.New(`You cannot use "verbose" and "patch" flags together`)

	// ErrorNotEnoughArguments indicates than user passed too few arguments
	ErrorNotEnoughArguments = errors.New(`Not enough arguments`)
)

Functions

This section is empty.

Types

type Options

type Options struct {
	Verbose, Quiet, DryRun, Patch bool
	PatchFile                     string
	Globs                         []string
	Name                          string
}

Options for application

func (*Options) Parse

func (options *Options) Parse(arguments []string) error

Parse parses options, emits error if any

func (*Options) ParseOrExit

func (options *Options) ParseOrExit(arguments []string)

ParseOrExit parses options, if any error calls os.Exit(2)

Jump to

Keyboard shortcuts

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