command

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package command implements the root command for the command line tool.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

Types

type Command

type Command struct {
	// contains filtered or unexported fields
}

func New

func New(config Config) (*Command, error)

New creates a new root command.

func (*Command) CobraCommand

func (c *Command) CobraCommand() *cobra.Command

func (*Command) Execute

func (c *Command) Execute(cmd *cobra.Command, args []string)

func (*Command) UpdateCommand

func (c *Command) UpdateCommand() *update.Command

func (*Command) VersionCommand

func (c *Command) VersionCommand() *version.Command

type Config

type Config struct {
	// Dependencies.
	Logger micrologger.Logger

	// Settings.
	Description string
	GitCommit   string
	Name        string
	Source      string
}

Config represents the configuration used to create a new root command.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig provides a default configuration to create a new root command by best effort.

Directories

Path Synopsis
Package update implements the update command for the command line tool.
Package update implements the update command for the command line tool.
Package version implements the version command for the command line tool.
Package version implements the version command for the command line tool.

Jump to

Keyboard shortcuts

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