flag

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VersionFalse versionValue = 0
	VersionTrue  versionValue = 1
	VersionRaw   versionValue = 2
)

Variables

This section is empty.

Functions

func AddFlags

func AddFlags(fs *pflag.FlagSet)

AddFlags 在任意 FlagSet 上注册此包的标志,以便它们指向与全局标志相同的值。

func PrintAndExitIfRequested

func PrintAndExitIfRequested()

PrintAndExitIfRequested 将检查 -version 是否被传递,如果是,则打印版本并退出。

func Version

func Version(name, shorthand string, value versionValue, usage string) *versionValue

Version 包装了 VersionVar 函数。

func VersionVar

func VersionVar(p *versionValue, name, shorthand string, value versionValue, usage string)

VersionVar 定义了一个具有指定名称和用法字符串的 pflag。

Types

This section is empty.

Jump to

Keyboard shortcuts

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