xcmd

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: Apache-2.0 Imports: 10 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInterrupted       = errors.New("interrupted")
	ErrMaxLengthExceeded = fmt.Errorf("maximum byte limit (%v) exceeded", maxLength)
)

Functions

func Args

func Args(fn func(cmd *Command)) func(cmd *Command) *Command

func GetPasswd

func GetPasswd(prompt ...string) ([]byte, error)

GetPasswd returns the password read from the terminal without echoing input. The returned byte array does not include end-of-line characters.

func GetPasswdMasked

func GetPasswdMasked(prompt ...string) ([]byte, error)

GetPasswdMasked returns the password read from the terminal, echoing asterisks. The returned byte array does not include end-of-line characters.

func GetPasswdPrompt

func GetPasswdPrompt(prompt string, mask bool, r fdReader, w io.Writer) ([]byte, error)

GetPasswdPrompt prompts the user and returns the password read from the terminal. If mask is true, then asterisks are echoed. The returned byte array does not include end-of-line characters.

func Init

func Init(cfn ...func(cmd *Command)) func(fn ...func(*Command))

func WithDebug added in v0.0.3

func WithDebug(debug ...bool) func(cmd *Command)

func WithHome added in v0.0.3

func WithHome(defaultHome ...string) func(cmd *Command)

func WithLogLevel added in v0.0.3

func WithLogLevel(ll ...string) func(cmd *Command)

func WithMode added in v0.0.3

func WithMode(mode ...string) func(cmd *Command)

Types

type Command

type Command = cobra.Command

Directories

Path Synopsis
Command mdserver is an http server serving directory (recursively) with markdown (.md) files.
Command mdserver is an http server serving directory (recursively) with markdown (.md) files.
res

Jump to

Keyboard shortcuts

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