globals

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package globals provides shared flag structures and utilities for CLI commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flags

type Flags struct {
	Output  string
	Quiet   bool
	Verbose bool
	NoColor bool
}

Flags holds global common flags across all commands.

func AddFlags

func AddFlags(cmd *cobra.Command) *Flags

AddFlags adds common flags to the root command.

func Parse

func Parse(cmd *cobra.Command) (*Flags, error)

Parse extracts global flags from the command hierarchy. This is useful for subcommands that need to access global flags when they weren't passed the flags struct directly.

type ResourceFlags

type ResourceFlags struct {
	Provider string
	Author   string
	Limit    int
	Search   string
	Filter   []string
	All      bool
}

ResourceFlags holds flags for resource-specific operations.

func AddResourceFlags

func AddResourceFlags(cmd *cobra.Command) *ResourceFlags

AddResourceFlags adds resource-specific flags to a command.

func ParseResources

func ParseResources(cmd *cobra.Command) *ResourceFlags

ParseResources extracts resource flags from a command.

Jump to

Keyboard shortcuts

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