Documentation
¶
Index ¶
- Constants
- func ActiveRecordingWidth() int
- func FinalizeRecording()
- func StartHelpRecording(cmd *cobra.Command, atmosConfig *schema.AtmosConfiguration) io.Writer
- 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 ¶
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