From d96e4ec394a51ac05aa0c4c4390aef6eb94f4b5e Mon Sep 17 00:00:00 2001 From: Stephen McQuay Date: Sun, 9 Sep 2018 19:09:56 -0700 Subject: [PATCH] Adds apple subcommand --- apple.go | 20 ++++++++++++++++++++ cmd/yay/main.go | 10 ++++++++++ 2 files changed, 30 insertions(+) create mode 100644 apple.go diff --git a/apple.go b/apple.go new file mode 100644 index 0000000..31c280a --- /dev/null +++ b/apple.go @@ -0,0 +1,20 @@ +package yay + +type Apple struct { + Sequence +} + +func NewApple() *Apple { + return &Apple{ + Sequence{ + Frames: [][]rune{ + []rune(` `), + []rune(`  `), + []rune(`  `), + []rune(` `), + []rune(`  `), + []rune(`  `), + }, + }, + } +} diff --git a/cmd/yay/main.go b/cmd/yay/main.go index fd314b7..1232eac 100644 --- a/cmd/yay/main.go +++ b/cmd/yay/main.go @@ -50,6 +50,15 @@ func main() { }, } + apple := &cobra.Command{ + Use: "apple", + Short: "Go Apple, Go!", + Run: func(cmd *cobra.Command, args []string) { + t := yay.NewViewPort(yay.NewApple(), time.Duration(frameRate)*time.Millisecond) + t.Run() + }, + } + version := &cobra.Command{ Use: "version", Short: "prints the version to stdout", @@ -60,6 +69,7 @@ func main() { main.AddCommand(shrug) main.AddCommand(dance) main.AddCommand(claps) + main.AddCommand(apple) main.AddCommand(version) main.Execute() }