Help us shape the future of Go! Take the 2026 Go Developer Survey

command

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package command provides shared configuration for sub-commands in the gh-models extension.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Out is where standard output is written.
	Out io.Writer
	// ErrOut is where error output is written.
	ErrOut io.Writer
	// Client is the client for interacting with the models service.
	Client azuremodels.Client
	// IsTerminalOutput is true if the output should be formatted for a terminal.
	IsTerminalOutput bool
	// TerminalWidth is the width of the terminal.
	TerminalWidth int
}

Config represents configurable settings for a command.

func NewConfig

func NewConfig(out, errOut io.Writer, client azuremodels.Client, isTerminalOutput bool, width int) *Config

NewConfig returns a new command configuration.

func NewConfigWithTerminal

func NewConfigWithTerminal(terminal term.Term, client azuremodels.Client) *Config

NewConfigWithTerminal returns a new command configuration using the given terminal.

func (*Config) NewTablePrinter

func (c *Config) NewTablePrinter() tableprinter.TablePrinter

NewTablePrinter initializes a table printer with terminal mode and terminal width.

func (*Config) WriteToOut

func (c *Config) WriteToOut(message string)

WriteToOut writes a message to the configured stdout writer.

Jump to

Keyboard shortcuts

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