flags

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: BSD-3-Clause Imports: 14 Imported by: 0

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