cli

package module
v0.0.0-...-9b286bb Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Name of the command line tool
	Name string

	// Copyright statement.
	Copyright string

	// License notice.
	License string

	// Version string.
	Version string

	// Homepage is the project's URL.
	Homepage string

	// Author is the name of the author.
	Author string

	// AuthorEmail is the e-mail of the author.
	AuthorEmail string
)

Functions

func Banner()

Banner displays a banner with information about the cli (if any).

func Dispatch

func Dispatch() error

Dispatch dispatches the subcommand.

func Execute

func Execute(name string) error

Execute executes a subcommand.

func Help

func Help(name string) error

Help shows help for a subcommand.

func Register

func Register(name string, entry Entry)

Register registers a subcommand.

func Usage

func Usage(name string) error

Usage shows a command's usage instructions.

Types

type Command

type Command interface {
	Execute() error
}

Command is a well-defined action for this cli.

type Entry

type Entry struct {
	Name        string
	Usage       string
	Description string
	Arguments   []string
	Command     Command
}

Entry represents a command

Jump to

Keyboard shortcuts

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