Skip to content

Commit

Permalink
Add gifs for all examples (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
FollowTheProcess authored Jan 16, 2025
1 parent e36c541 commit f52dfee
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 4 deletions.
Binary file added docs/img/namedargs.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/quickstart.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/subcommands.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions docs/src/namedargs.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Output ./docs/img/namedargs.gif

Set FontSize 18
Set FontFamily "Geist Mono"
Set Theme "Catppuccin Macchiato"
Set WindowBar Colorful
Set Padding 5
Set Height 800
Set Width 1200
Set Margin 40
Set MarginFill "#7983FF"
Set BorderRadius 10
Set TypingSpeed 100ms

# Setup
Hide
Type "go build -o ./namedargs ./examples/namedargs && clear" Sleep 2s
Enter
Sleep 2s
Show
Sleep 1s

Type "./namedargs --help" Sleep 500ms Enter

Sleep 8s

Type "clear" Sleep 500ms Enter

Sleep 1s

# Cleanup
Hide
Type "rm -f ./namedargs"
Enter
7 changes: 3 additions & 4 deletions docs/src/quickstart.tape
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
# Run from the repo root
Output ./docs/img/quickstart.gif

Set Shell fish
Set FontSize 18
Set FontFamily "Geist Mono"
Set Theme "Catppuccin Macchiato"
Expand All @@ -81,19 +80,19 @@ Sleep 1s

Type "./quickstart --help" Sleep 500ms Enter

Sleep 4s
Sleep 8s

Type "clear" Sleep 500ms Enter

Sleep 1s

Type "./quickstart --version" Sleep 500ms Enter

Sleep 2s
Sleep 4s

Type "./quickstart something --count 3" Sleep 500ms Enter

Sleep 2s
Sleep 4s

Type "./quickstart" Sleep 500ms Enter

Expand Down
66 changes: 66 additions & 0 deletions docs/src/subcommands.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
Output ./docs/img/subcommands.gif

Set FontSize 18
Set FontFamily "Geist Mono"
Set Theme "Catppuccin Macchiato"
Set WindowBar Colorful
Set Padding 5
Set Height 800
Set Width 1200
Set Margin 40
Set MarginFill "#7983FF"
Set BorderRadius 10
Set TypingSpeed 100ms

# Setup
Hide
Type "go build -o ./subcommands ./examples/subcommands && clear" Sleep 2s
Enter
Sleep 2s
Show
Sleep 1s

Type "./subcommands --help" Sleep 500ms Enter

Sleep 8s

Type "clear" Sleep 500ms Enter

Sleep 1s

Type "./subcommands say --help" Sleep 500ms Enter

Sleep 4s

Type "clear" Sleep 500ms Enter

Sleep 1s

Type "./subcommands do --help" Sleep 500ms Enter

Sleep 4s

Type "clear" Sleep 500ms Enter

Sleep 1s

Type "./subcommands say 'hello world' --shout --thing demo --count 42" Sleep 500ms Enter

Sleep 4s

Type "clear" Sleep 500ms Enter

Sleep 1s

Type "./subcommands do 'something' --fast --count 3 -vvv" Sleep 500ms Enter

Sleep 4s

Type "clear" Sleep 500ms Enter

Sleep 1s

# Cleanup
Hide
Type "rm -f ./subcommands"
Enter
6 changes: 6 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@ Not really an example, but holds the source code used to generate the cover imag

Implements the [quickstart] command from the main project README

![quickstart](../docs/img/quickstart.gif)

## `./subcommands`

A CLI with multiple subcommands, each with their own flags and expected arguments. Shows how to easily store parsed flag values in an options struct and pass them around your program.

![subcommands](../docs/img/subcommands.gif)

## `./namedargs`

A CLI with named positional arguments that may or may not have default values. Shows how to retrieve these arguments by name and use them without having to care if they were provided or you're using the default.

![namedargs](../docs/img/namedargs.gif)

[quickstart]: https://github.com/FollowTheProcess/cli#quickstart
[silicon]: https://github.com/Aloxaf/silicon

0 comments on commit f52dfee

Please sign in to comment.