commands

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RootCommand

type RootCommand struct {
	Output string `flag:"output,required" short:"o" description:"output file name"`
	Num    int    `flag:"num" default:"42" description:"some number for command"`
	IsOK   bool   `flag:"is-ok,persist" short:"i" default:"true" description:"some persistent flag"`
}

RootCommand with @Cobra(

usage = "cli",
example = "cli [-F file | -D dir] ... [-f format] profile",
short = "Root command of the application (short)",
long = "Root command of the application (long)",

)

func (RootCommand) PreRun

func (c RootCommand) PreRun(cmd *cobra.Command, agrs []string) error

PreRun - @CobraPreRun command

func (RootCommand) Run

func (c RootCommand) Run(cmd *cobra.Command, agrs []string) error

Run - @CobraRun command

Directories

Path Synopsis
get

Jump to

Keyboard shortcuts

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