verflag

package
v0.0.0-...-4f9d474 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 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 string, value versionValue, usage string) *versionValue

Version 包装了 VersionVar 函数.

func VersionVar

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

VersionVar 定义了一个具有指定名称和用法的标志.

Types

This section is empty.

Jump to

Keyboard shortcuts

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