Documentation ¶
Index ¶
Constants ¶
View Source
const QUICLI_ERROR_PREFIX = "quicli error: "
Variables ¶
View Source
var AllAliases mapset.Set[string]
Functions ¶
Types ¶
type Cli ¶
type Cli struct { Usage string Description string Flags []Flag Function Runner CheatSheet []Example Subcommands []Subcommand }
struct representing CLI
func (*Cli) Parse ¶
Parse: parse the different flags and return the struct containing the flag values. This is the core of the library. All the logic is within
func (*Cli) PrintCheatSheet ¶
func (c *Cli) PrintCheatSheet()
PrintCheatSheet: print the cheat sheet of the command
func (*Cli) Run ¶ added in v0.0.4
func (c *Cli) Run()
Run: parse the different flags and run the function of the cli. Users have to define it, this is the core/logic of their application
func (*Cli) RunWithSubcommand ¶ added in v0.0.5
func (c *Cli) RunWithSubcommand()
RunWithSubcommand: equivalent of Run function when cli has subcommand defined
type Config ¶
func (Config) GetBoolFlag ¶
return the string value of a string flag
func (Config) GetIntFlag ¶
return the int value of an interger flag
func (Config) GetStringFlag ¶
return the string value of a string flag
type Flag ¶
type Flag struct { Name string Description string //Default is use to determine the flag value type and must be defined Default interface{} NoShortName bool NotForRootCommand bool ForSubcommand SubcommandSet }
struct representing a cli flag
type Subcommand ¶ added in v0.0.5
type Subcommand struct { Name string Aliases mapset.Set[string] Description string Function Runner }
Subcommand
type SubcommandSet ¶ added in v0.0.5
type SubcommandSet []string
type Subcommands ¶ added in v0.0.5
type Subcommands []Subcommand
Click to show internal directories.
Click to hide internal directories.