commands

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2018 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package commands exposes a run method for main() to call

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Commands

func Commands() map[string]CommandProvider

Commands returns a map from name to registered CommandProvider.

func Register

func Register(name string, provider CommandProvider)

Register will register a CommandProvider, this is intended to be used during sstatic initializtion and will panic if name is already in use.

func Run

func Run(argv []string) (exitCode int)

Run will parse command line arguments and run available commands.

Types

type CommandProvider

type CommandProvider interface {
	// Summary returns a one-line description of what this command is for.
	Summary() string
	// Usage returns the docopt usage string, used to parse arguments.
	Usage() string
	// Execute is called with parsed docopt result, return true/false if the
	// utility should exit zero or non-zero.
	Execute(args map[string]interface{}) bool
}

CommandProvider is implemented by anyone who wishes to provide a command line command that the worker should support.

Directories

Path Synopsis
Package help provides the help command.
Package help provides the help command.
Package qemuguesttools implements the command that runs inside a QEMU VM.
Package qemuguesttools implements the command that runs inside a QEMU VM.
Package shell provides a CommandProvider that implements a CLI tool for opening to a interactive shell to an interactive taskcluster-worker task in your terminal.
Package shell provides a CommandProvider that implements a CLI tool for opening to a interactive shell to an interactive taskcluster-worker task in your terminal.
Package version provides a CommandProvider that displays version number and git revision, these values are also exported through methods so that they can be read from other packages.
Package version provides a CommandProvider that displays version number and git revision, these values are also exported through methods so that they can be read from other packages.

Jump to

Keyboard shortcuts

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