Help us shape the future of Go! Take the 2026 Go Developer Survey

cli

package
v1.0.0-a2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package cli contains the dgo CLI (Command Line Interface)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	// Do parses the arguments and runs the command
	Do([]string) int

	// Help prints the help for the command
	Help()

	// MissingOption prints the missing option error for the given option and returns 1
	MissingOption(string) int

	// RunWithCatch runs the given function, recovers error panics and reports them. It returns a non zero exit status
	// in case an error was recovered
	RunWithCatch(func() int) int

	// Name returns the name of the command
	Name() string

	// Err returns the error output writer
	Err() io.Writer

	// Out returns the output writer
	Out() io.Writer

	// Verbose returns the verbosity
	Verbose() bool
}

Command is the interface implemented by all dgo commands. Both global and sub commands.

func Dgo

func Dgo(out, err io.Writer) Command

Dgo creates the global dgo command

func Validate

func Validate(parent Command) Command

Validate is the Dgo sub command that reads and validates YAML input using a spec written in YAML or Dgo

Directories

Path Synopsis
Package main contains the main dgo CLI command.
Package main contains the main dgo CLI command.

Jump to

Keyboard shortcuts

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