flagbind

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package flagbind provides helpers for cobra flag registration.

Package register provides helpers for cobra flag registration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LastJSON

func LastJSON(c *cobra.Command, lastDefault int, lastDescKey, jsonDescKey string)

LastJSON registers the --last (int) and --json (bool) flag pair used by list-style commands.

Parameters:

  • c: Cobra command to register on
  • lastDefault: Default value for --last
  • lastDescKey: YAML DescKey for the --last flag description
  • jsonDescKey: YAML DescKey for the --json flag description

func StringFlag

func StringFlag(c *cobra.Command, p *string, name, descKey string)

StringFlag registers a string flag with no shorthand.

Parameters:

  • c: Cobra command to register on
  • p: Pointer to the string variable
  • name: Flag name constant
  • descKey: YAML DescKey for the flag description

func StringFlagP

func StringFlagP(c *cobra.Command, p *string, name, short, descKey string)

StringFlagP registers a string flag with a shorthand letter.

Parameters:

  • c: Cobra command to register on
  • p: Pointer to the string variable
  • name: Flag name constant
  • short: Shorthand letter
  • descKey: YAML DescKey for the flag description

Types

This section is empty.

Jump to

Keyboard shortcuts

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