util

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: BSD-3-Clause Imports: 1 Imported by: 182

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Usage

func Usage(wrapUsage func(), message string) func()

Usage wraps a passed in func() with a func() that sets os.Args[0] to a string and then calls the func().

It is intended to be called with Usage function from a flag package, such as flag or spf13/pflag. E.g., flag.usage = util.Usage(flag.Usage, "some message")

Usage must not import "flag", since callers might use an alternate flags package such as spf13/pflag, and would set Usage for a flag package that the caller is not using.

Types

This section is empty.

Jump to

Keyboard shortcuts

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