cli

package
v0.0.0-...-a5cf2d8 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2017 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	GlobalFile     string            // Location of the global task list
	CurrentWorkDir string            // Path where the program was executed from
	CurrentGlobal  bool              // If the current command is global or local
	CliOutput      *Writer           // Where the application will output when writing to the console (stdout/stderr)
	CurrentFile    *bufio.ReadWriter // File we're currently working with, need to read and write to it
}

func NewApplication

func NewApplication() *Application

NewApplication returns a struct containing settings we want to access across the entire program

type Writer

type Writer struct {
	StdOut *bufio.Writer
	StdErr *bufio.Writer
}

func NewStdOutput

func NewStdOutput() *Writer

NewStdOutput returns an CliOutput with stdout and stderr has its main outputs

func NewTestOutput

func NewTestOutput() (*Writer, *bytes.Buffer, *bytes.Buffer)

NewTestOutput returns an CliOutput that can be used for testing. It also provides a bytes buffer for stdout and stderr

func (*Writer) Error

func (output *Writer) Error(error error) (len int, err error)

Error outputs an error message to the standard error output

func (*Writer) Write

func (output *Writer) Write(line string) (len int, err error)

Write outputs a string to the standard output

Jump to

Keyboard shortcuts

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