Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandPrint ¶
CommandPrint is an example command that prints positional and dashed arguments. It demonstrates the use of flags, argument validation, and error handling.
func (*CommandPrint) Description ¶
func (cmd *CommandPrint) Description() string
Description returns a detailed description of the CommandPrint command.
func (*CommandPrint) Examples ¶
func (cmd *CommandPrint) Examples() []string
Examples returns a slice of example usage strings for the CommandPrint command.
func (*CommandPrint) Execute ¶
func (cmd *CommandPrint) Execute(_ context.Context, args, dashedArgs []string) error
Execute implements the main logic of the CommandPrint command. It processes positional and dashed arguments, validates the number of arguments, and prints the arguments along with their corresponding flag values (if any).
func (*CommandPrint) Flags ¶
func (cmd *CommandPrint) Flags() []cli.Flag
Flags returns the command-line flags for the CommandPrint command. It defines flags for 'a', 'b', and 'c' options, using built-in flag types.
func (*CommandPrint) Usage ¶
func (cmd *CommandPrint) Usage() string
Usage returns the usage string for the CommandPrint command, indicating the expected positional and dashed arguments.
type CommandRoot ¶
type CommandRoot struct{}
CommandRoot is the root command for the example CLI application. It provides a general description of the application.
func (CommandRoot) Description ¶
func (CommandRoot) Description() string
Description returns a description of the example CLI application.