cmd

package
v0.17.0-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: Apache-2.0 Imports: 5 Imported by: 53

Documentation

Overview

Package cmd provides helpers used by kind's commands / cli

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorEnabled

func ColorEnabled(logger log.Logger) bool

ColorEnabled returns true if color is enabled for the logger this should be used to control output

func NewLogger

func NewLogger() log.Logger

NewLogger returns the standard logger used by the kind CLI This logger writes to os.Stderr

Types

type IOStreams

type IOStreams struct {
	// In think, os.Stdin
	In io.Reader
	// Out think, os.Stdout
	Out io.Writer
	// ErrOut think, os.Stderr
	ErrOut io.Writer
}

IOStreams provides the standard names for iostreams. This is useful for embedding and for unit testing. Inconsistent and different names make it hard to read and review code This is based on cli-runtime, but just the nice type without the dependency

func StandardIOStreams

func StandardIOStreams() IOStreams

StandardIOStreams returns an IOStreams from os.Stdin, os.Stdout

Directories

Path Synopsis
Package kind implements the root kind cobra command, and the cli Main()
Package kind implements the root kind cobra command, and the cli Main()

Jump to

Keyboard shortcuts

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