diff --git a/cmd/stories/main.go b/cmd/stories/main.go index c5c630ed..91b41ea8 100644 --- a/cmd/stories/main.go +++ b/cmd/stories/main.go @@ -30,6 +30,8 @@ var CLI struct { Prefix string `help:"Pre-filter the list of stories." name:"prefix" optional:"" short:"p"` Single string `help:"Show a single story in full screen, overriding its config." name:"single" optional:"" short:"s"` Cast string `help:"Save an asciinema cast to the given filename. Must be used in tandem with --single." name:"cast" optional:"" short:"c"` + Width int `help:"Set the width of the terminal when saving an asciinema cast." name:"width" optional:"" short:"w" default:"80"` + Height int `help:"Set the height of the terminal when saving an asciinema cast." name:"height" optional:"" short:"h" default:"26"` } func main() { @@ -85,7 +87,10 @@ func main() { } var cols, rows int = 80, 26 - if !haveCast { + if haveCast { + cols = CLI.Width + rows = CLI.Height + } else { cols, rows, err = term.GetSize(int(os.Stdin.Fd())) if err != nil { panic(err) diff --git a/docs/src/quick-start.md b/docs/src/quick-start.md index 51de1e07..abfedf77 100644 --- a/docs/src/quick-start.md +++ b/docs/src/quick-start.md @@ -22,7 +22,7 @@ If your terminal is wider than 80 columns, you'll notice that the pane does not All actions in `cy`, such as creating panes and switching between them, are triggered by sequences of keys. -{{story cast cy/viewport}} +{{story cast cy/viewport -w 100}} Here are a few you can try: