flags

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package flags defines CLI flag types for all commands.

Index

Constants

View Source
const (
	// DefaultTimeout is the default API call timeout in seconds.
	DefaultTimeout = 30
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonFlags

type CommonFlags struct {
	// LogLevel sets the logging verbosity level (debug, info, warn, error).
	LogLevel string
	// Config is the path to the configuration file.
	Config string
	// Quiet suppresses all output except errors.
	Quiet bool
	// Verbose enables verbose output.
	Verbose bool
}

CommonFlags contains flags common to multiple commands.

func (*CommonFlags) Bind

func (cf *CommonFlags) Bind(flags *pflag.FlagSet)

Bind attaches the common flags to the provided flag set.

Parameters:

  • flags: The flag set to attach common flags to.

func (*CommonFlags) Validate

func (cf *CommonFlags) Validate() error

Validate checks the common flags for consistency.

type ServerFlags

type ServerFlags struct {
	// ListenAddr is the address the server listens on.
	ListenAddr string
}

ServerFlags contains flags specific to the server start command.

func (*ServerFlags) Bind

func (sf *ServerFlags) Bind(flags *pflag.FlagSet)

Bind attaches server-specific flags to the provided flag set.

type VersionFlags

type VersionFlags struct {
	CommonFlags

	// JSON outputs version information in JSON format.
	JSON bool
}

VersionFlags contains flags for the version command.

func (*VersionFlags) Bind

func (vf *VersionFlags) Bind(flags *pflag.FlagSet)

Bind attaches version-specific flags to the provided flag set. Common flags (log-level, config, quiet, verbose) are inherited from the root command's persistent flags and are not re-bound here.

Jump to

Keyboard shortcuts

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