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

cast

package
v1.233.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FlagName is the global flag used to record command output as an asciicast.
	FlagName = cfg.CastFlagName

	// EnvName is the environment variable used to request cast recording.
	EnvName = cfg.CastEnvVarName
)

Variables

This section is empty.

Functions

func ActiveRecordingWidth

func ActiveRecordingWidth() int

ActiveRecordingWidth returns the terminal width (in columns) of the active cast recording, or 0 when no recording is running. Help rendering uses this so recorded output is laid out at the recorded terminal width.

func FinalizeRecording

func FinalizeRecording()

FinalizeRecording closes the active root-command cast recorder, if one is running.

func StartHelpRecording

func StartHelpRecording(cmd *cobra.Command, atmosConfig *schema.AtmosConfiguration) bool

StartHelpRecording starts a cast recording for help output when explicitly requested. Cobra renders help before the persistent pre-run hooks fire, so the custom help function must start the recorder itself. Help output still flows through the normal masked I/O writer, which is the sole path that records it. It returns true when a recording is active.

func StartRecordingIfRequested

func StartRecordingIfRequested(cmd *cobra.Command, atmosConfig *schema.AtmosConfiguration, args []string) error

StartRecordingIfRequested starts the root-command cast recorder when enabled by config or flag.

Types

type CommandProvider

type CommandProvider struct{}

func (*CommandProvider) GetAliases

func (p *CommandProvider) GetAliases() []internal.CommandAlias

func (*CommandProvider) GetCommand

func (p *CommandProvider) GetCommand() *cobra.Command

func (*CommandProvider) GetCompatibilityFlags

func (p *CommandProvider) GetCompatibilityFlags() map[string]compat.CompatibilityFlag

func (*CommandProvider) GetFlagsBuilder

func (p *CommandProvider) GetFlagsBuilder() flags.Builder

func (*CommandProvider) GetGroup

func (p *CommandProvider) GetGroup() string

func (*CommandProvider) GetName

func (p *CommandProvider) GetName() string

func (*CommandProvider) GetPositionalArgsBuilder

func (p *CommandProvider) GetPositionalArgsBuilder() *flags.PositionalArgsBuilder

func (*CommandProvider) IsExperimental

func (p *CommandProvider) IsExperimental() bool

Jump to

Keyboard shortcuts

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