flags

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: BSD-3-Clause Imports: 14 Imported by: 0 modules, 0 packages

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.

Documentation

Overview

SPDX-FileCopyrightText: 2026 Outscale SAS <opensource@outscale.com>

SPDX-License-Identifier: BSD-3-Clause

SPDX-FileCopyrightText: 2026 Outscale SAS <opensource@outscale.com>

SPDX-License-Identifier: BSD-3-Clause

Index

Constants

This section is empty.

Variables

View Source
var NumEntriesInSlices = 1

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(cfg config.Config, opts ...Option) *Builder

func (*Builder) Build

func (b *Builder) Build(fs *FlagSet, arg reflect.Type, prefix string, allowRequired bool)

type Enum added in v0.0.14

type Enum interface {
	Values() []string
}

type Flag

type Flag struct {
	Name          string
	FieldPath     string
	Kind          reflect.Kind
	Slice         bool
	Help          string
	Required      bool
	AllowedValues []string
	FlagValue     pflag.Value
}

type FlagSet

type FlagSet []Flag

func (*FlagSet) Add

func (fs *FlagSet) Add(f Flag)

type Normalize

type Normalize func(string) string

type Option

type Option func(*Builder)

func RequiredFromPointer added in v0.0.14

func RequiredFromPointer(required bool) Option

func WithNormalize

func WithNormalize(fn Normalize) Option

Jump to

Keyboard shortcuts

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