Thanks to visit codestin.com
Credit goes to pkg.go.dev

cmd

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute() error

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func NewRootCmd added in v1.10.1

func NewRootCmd() *cobra.Command

NewRootCmd returns the root command (for generating documentation)

func ResetSettings added in v1.0.0

func ResetSettings()

ResetSettings resets command settings to default. This is only required by the test suite to make sure that the flag parsing works correctly.

Types

type ExitCode added in v1.0.0

type ExitCode interface {
	Value() int
	Cause() error
	Error() string
}

ExitCode is an error interface that has exit code (value) details

type OutputWriter

type OutputWriter struct {
	PlainMode        bool
	Restructure      bool
	OmitIndentHelper bool
	OutputStyle      string
}

OutputWriter encapsulates the required fields to define the look and feel of the output

func (*OutputWriter) WriteInplace

func (w *OutputWriter) WriteInplace(filename string) error

WriteInplace writes the content of the documents stored in the provided input file to the file itself overwriting the content in place.

func (*OutputWriter) WriteToStdout

func (w *OutputWriter) WriteToStdout(filename string) error

WriteToStdout is a convenience function to write the content of the documents stored in the provided input file to the standard output

Jump to

Keyboard shortcuts

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