flags

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package flags manages command-line flag binding and configuration for godyl.

It provides utilities for binding cobra flags to viper configuration and defines standardized flag sets for different command types. This package handles environment variable integration, flag parsing, and configuration unmarshalling to ensure consistent behavior across all commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bind

func Bind(cmd *cobra.Command, cfg any, prefix ...string) error

Bind connects cobra flags to viper and unmarshals the configuration into the provided struct. It sets up environment variable handling with the given prefix and handles flag binding.

func Root

func Root(cmd *cobra.Command)

Root adds the root-level command flags to the provided cobra command. These flags apply to the root command.

func Tool

func Tool(cmd *cobra.Command)

Tool adds tool-related command flags to the provided cobra command. These flags control how tools are downloaded and installed.

func Update

func Update(cmd *cobra.Command)

Update adds update-related command flags to the provided cobra command. These flags control the self-update.

Types

This section is empty.

Jump to

Keyboard shortcuts

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