options

package
v0.0.0-...-5a29955 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 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