Documentation
¶
Index ¶
- Constants
- func ActiveRecordingWidth() int
- func FinalizeRecording()
- func StartHelpRecording(cmd *cobra.Command, atmosConfig *schema.AtmosConfiguration) bool
- func StartRecordingIfRequested(cmd *cobra.Command, atmosConfig *schema.AtmosConfiguration, args []string) error
- type CommandProvider
- func (p *CommandProvider) GetAliases() []internal.CommandAlias
- func (p *CommandProvider) GetCommand() *cobra.Command
- func (p *CommandProvider) GetCompatibilityFlags() map[string]compat.CompatibilityFlag
- func (p *CommandProvider) GetFlagsBuilder() flags.Builder
- func (p *CommandProvider) GetGroup() string
- func (p *CommandProvider) GetName() string
- func (p *CommandProvider) GetPositionalArgsBuilder() *flags.PositionalArgsBuilder
- func (p *CommandProvider) IsExperimental() bool
Constants ¶
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