dfsrflag

package
v0.0.0-...-2e8e066 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2019 License: MIT Imports: 4 Imported by: 2

Documentation

Overview

Package dfsrflag provides common flag value implementations used by commands in the dfsr library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RegexpSlice

type RegexpSlice []*regexp.Regexp

RegexpSlice is a flag value that parses one or more regular expressions.

All regular expressions parsed by this type will be case-insensitive.

func (*RegexpSlice) Set

func (s *RegexpSlice) Set(value string) error

Set compiles value and adds it to s. The regular expression will be case-insensitive.

If the regular expression cannot be compiled an error will be returned.

func (*RegexpSlice) String

func (s *RegexpSlice) String() string

String returns a string representation of the regular expression slice.

type UintOrInf

type UintOrInf struct {
	Present bool
	Inf     bool
	Value   uint
}

UintOrInf stores an unsigned integer value that can be used by the flag package. It is capable of indicating the special value infinity and whether a value was specified or not.

func (*UintOrInf) Set

func (u *UintOrInf) Set(value string) (err error)

Set parses the given value and assigns it to u.

If value cannot be parsed an error will be returned.

func (*UintOrInf) String

func (u *UintOrInf) String() string

String returns a string representation of the unsigned integer.

Jump to

Keyboard shortcuts

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