simple

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package simple demonstrates basic usage of the cli package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEchoCommand

func NewEchoCommand() cli.Command

NewEchoCommand creates a new echo command.

func NewGreetCommand

func NewGreetCommand() cli.Command

NewGreetCommand creates a new greet command.

Types

type EchoCommand

type EchoCommand struct {
	// contains filtered or unexported fields
}

EchoCommand demonstrates a command with flags.

func (*EchoCommand) BindFlags

func (c *EchoCommand) BindFlags(fs *pflag.FlagSet)

BindFlags binds the command flags.

func (*EchoCommand) Name

func (c *EchoCommand) Name() string

Name returns the command name.

func (*EchoCommand) Run

func (c *EchoCommand) Run(_ *cobra.Command, args []string) error

Run executes the command.

type GreetCommand

type GreetCommand struct{}

GreetCommand is the simplest command - no flags, just positional args.

func (*GreetCommand) Name

func (c *GreetCommand) Name() string

Name returns the command name.

func (*GreetCommand) Run

func (c *GreetCommand) Run(_ *cobra.Command, args []string) error

Run executes the command.

Jump to

Keyboard shortcuts

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