commands

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "1.2.0"

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Title   string
	MaxWait float64
	Yes     bool
	Quite   bool
}

Options options to pass to various commands. These are common flags passed to the asciinema cli.

func New

func New(opts ...Options) *Options

New creates a new Options instance.

func (*Options) Play

func (o *Options) Play(cast *asciicast.Asciicast) error

Play plays the given asciicast. Use asciicast.Asciicast to unmarshal read from the asciicast file.

func (*Options) Rec

func (o *Options) Rec() (*asciicast.Asciicast, *bytes.Buffer, error)

Rec records the terminal and returns the asciicast and error.

type PlayCommand

type PlayCommand struct {
	Player asciicast.Player
}

func NewPlayCommand

func NewPlayCommand() *PlayCommand

func (*PlayCommand) Execute

func (c *PlayCommand) Execute(cast *asciicast.Asciicast, maxWait float64) error

type RecordCommand

type RecordCommand struct {
	Env      map[string]string
	Recorder asciicast.Recorder
}

func NewRecordCommand

func NewRecordCommand(env map[string]string) *RecordCommand

func (*RecordCommand) Execute

func (c *RecordCommand) Execute(command, title string, assumeYes bool, maxWait float64) (asciicast.Asciicast, error)

Jump to

Keyboard shortcuts

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