multiflag

package module
v0.0.0-...-134760c Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: MIT Imports: 2 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

multiflag

Little helper module for creating flags with multiple names (e.g. -r, -R & --recursive)

https://godoc.org/github.com/aporcupine/multiflag

Usage Example

import "github.com/aporcupine/multiflag"

var (
  recursive = multiflag.Bool(false, "remove recursively", "r", "R", "recursive")
  config = multiflag.String("/etc/myconfig", "location of config file", "c", "config")
)

Documentation

Overview

Package multiflag implements helper functions for creating flags with multiple names.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(value bool, usage string, names ...string) *bool

Bool defines a bool flag with specified default value, usage string and, names. The return value is the address of a bool variable that stores the value of the flag.

func Duration

func Duration(value time.Duration, usage string, names ...string) *time.Duration

Duration defines a time.Duration flag with specified default value, usage string, and names. The return value is the address of a time.Duration variable that stores the value of the flag. The flag accepts a value acceptable to time.ParseDuration.

func Float64

func Float64(value float64, usage string, names ...string) *float64

Float64 defines a float64 flag with specified default value, usage string, and names. The return value is the address of a float64 variable that stores the value of the flag.

func Int

func Int(value int, usage string, names ...string) *int

Int defines an int flag with specified default value, usage string, and names. The return value is the address of an int variable that stores the value of the flag.

func Int64

func Int64(value int64, usage string, names ...string) *int64

Int64 defines an int64 flag with specified default value, usage string, and names. The return value is the address of an int64 variable that stores the value of the flag.

func String

func String(value string, usage string, names ...string) *string

String defines a string flag with specified default value, usage string, and names. The return value is the address of a string variable that stores the value of the flag.

func Uint

func Uint(value uint, usage string, names ...string) *uint

Uint defines a uint flag with specified default value, usage string, and names. The return value is the address of a uint variable that stores the value of the flag.

func Uint64

func Uint64(value uint64, usage string, names ...string) *uint64

Uint64 defines a uint64 flag with specified default value, usage string, and names. The return value is the address of a uint64 variable that stores the value of the flag.

Types

This section is empty.

Jump to

Keyboard shortcuts

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