cast

package
v1.223.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 20 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) io.Writer

StartHelpRecording starts a cast recording for help output when an explicit --cast flag requests one, and returns a writer that records what is written to it as cast output events. Cobra renders help before the persistent pre-run hooks fire, so the custom help function starts the recording itself and tees the rendered help through the returned writer. It returns nil when no recording is active or requested.

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