cmd

package
v0.0.0-...-071115b Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFlag

func AddFlag(cmd Flag)

Function to add new command to CLI tool.

func Execute

func Execute()

func Gen

func Gen(cmd *cobra.Command, args []string)

func Go

func Go(cmd *cobra.Command, args []string)

func Infr

func Infr(cmd *cobra.Command, args []string)

func List

func List(cmd *cobra.Command, args []string)

func WarnDefault

func WarnDefault(actual string, initial string)

Types

type Flag

type Flag struct {
	// Cobra command that we will bound our cmd to
	Cmd *cobra.Command
	// Name of command in CLI
	Name string
	// Optional short name for command, leave empty to skip short name
	ShortName string
	// Environment variable to read from
	Env string
	// Regular name for the flag
	Value string
	// Wether this value should be provided by user
	IsRequired bool
	// Leave empty if type is string: ["", "strarr", "bool"]
	Type string
	// Description for flag
	Description string
}

Short description of contents for command.

Jump to

Keyboard shortcuts

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