command

package
v0.0.259-pre-1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2021 License: Apache-2.0 Imports: 21 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package command implements helpers useful for when building cobra commands.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplementedYet = errors.New("command not implemented yet")

TODO: remove once all commands are implemented.

Functions

func FromContext

func FromContext(ctx context.Context) *cobra.Command

FromContext returns the Command ctx carries. It panics in case ctx carries no Command.

func New

func New(usage, short, long string, fn Runner, p ...Preparer) *cobra.Command

func NewContext

func NewContext(ctx context.Context, cmd *cobra.Command) context.Context

NewContext derives a context that carries cmd from ctx.

func RequireSession

func RequireSession(ctx context.Context) (context.Context, error)

RequireSession is a Preparer which makes sure a session exists.

func WrapRunE

func WrapRunE(fn func(*cobra.Command, []string) error) func(*cobra.Command, []string) error

TODO: remove after migration is complete

Types

type Preparer

type Preparer func(context.Context) (context.Context, error)

type Runner

type Runner func(context.Context) error

Directories

Path Synopsis
Package apps implements the apps command chain.
Package apps implements the apps command chain.
Package root implements the root command.
Package root implements the root command.
Package version implements the version command chain.
Package version implements the version command chain.

Jump to

Keyboard shortcuts

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