gofacade

package module
v0.1.1-0...-e90ff3c Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2016 License: CC0-1.0 Imports: 2 Imported by: 0

README

gofacade - Facade Pattern for CLI

Build Status GitHub license

Sample Code

See spiegel-im-spiegel/astrocalc.

License

These codes are licensed under CC0.

CC0

Documentation

Overview

Package gofacade for CLI Application

These codes are licensed under CC0. http://creativecommons.org/publicdomain/zero/1.0/

Index

Constants

View Source
const (
	ExitSuccess = iota
	ExitFailure
)

Exit Status

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	//Embedded BasicUi
	*cli.BasicUi
}

Context inheritance cli.BasicUi

func NewContext

func NewContext(r io.Reader, w, e io.Writer) *Context

NewContext returns a new Context instance

type Facade

type Facade struct {
	//UI defines user interface of the Cli
	Cxt *Context
	// contains filtered or unexported fields
}

Facade is context of facade

func NewFacade

func NewFacade(cxt *Context) *Facade

NewFacade returns a new Facade instance

func (*Facade) AddCommand

func (f *Facade) AddCommand(name string, command cli.Command)

AddCommand add command

func (*Facade) Run

func (f *Facade) Run(appName, version string, args []string) (int, error)

Run facade

Jump to

Keyboard shortcuts

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