subcmd

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FmtScanln = fmt.Scanln

FmtScanln is wrapper for fmt.Scanln(). It's for unit test.

Functions

func Question

func Question(w io.Writer, ask string) bool

Question displays the question in the terminal and receives an answer from the user.

func Run

func Run(cmd *cobra.Command, args []string, subCmd SubCommand) error

Run runs the subcommand.

Types

type Doer

type Doer interface {
	Do() error
}

Doer is an interface that represents the behavior of a command.

type SubCommand

type SubCommand interface {
	Parse(cmd *cobra.Command, args []string) error
	Doer
}

SubCommand is an interface that represents the behavior of a command.

Directories

Path Synopsis
Package cfn is the root command of cfn.
Package cfn is the root command of cfn.
Package s3hub is the root command of s3hub.
Package s3hub is the root command of s3hub.
Package spare is a package that contains subcommands for the spare CLI command.
Package spare is a package that contains subcommands for the spare CLI command.

Jump to

Keyboard shortcuts

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