cmd

package
v0.0.0-...-947c9d0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arguments

type Arguments []string

type Command

type Command struct {
	// The name of the command.
	Name string
	// Aliases of the name.
	// e.g. version -> v
	Aliases []string
	// A summary explaining the function of the command.
	Summary string

	// A list of sub commands.
	Commands []Command

	// A list of arguments.
	Args Arguments
	// Options of the command.
	// e.g. --all, etc.
	Options []Option
	// The method corresponding with a list of arguments.
	Method func(args []string, options map[string]string) error
}

A command with either sub-commands or a list of arguments.

func (Command) Call

func (c Command) Call(args ...string) error

func (Command) Help

func (c Command) Help()

type Option

type Option struct {
	Name     string
	HasValue bool
}

Jump to

Keyboard shortcuts

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