cmdutil

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package cmdutil provides utilities for working with the command-line entrypoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUsageFunc

func NewUsageFunc(cfg UsageConfig) func()

NewUsageFunc returns a function that returns a usage string.

Types

type UsageConfig

type UsageConfig struct {
	// Name is the name of the command.
	Name string
	// Description is the description of the command.
	Description string
	// Prefixes is a list of flag prefixes to
	// break into sections in the usage string.
	Prefixes []string
	// Flagset is the flagset to use for the command.
	Flagset *pflag.FlagSet
	// SkipPrefixes is a list of prefixes to skip
	// when building the usage string.
	SkipPrefixes []string
}

UsageConfig is the config for building a usage string.

Jump to

Keyboard shortcuts

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