Adds apple subcommand
This commit is contained in:
parent
3dab222c48
commit
d96e4ec394
20
apple.go
Normal file
20
apple.go
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
package yay
|
||||||
|
|
||||||
|
type Apple struct {
|
||||||
|
Sequence
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewApple() *Apple {
|
||||||
|
return &Apple{
|
||||||
|
Sequence{
|
||||||
|
Frames: [][]rune{
|
||||||
|
[]rune(` `),
|
||||||
|
[]rune(` `),
|
||||||
|
[]rune(` `),
|
||||||
|
[]rune(` `),
|
||||||
|
[]rune(` `),
|
||||||
|
[]rune(` `),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
@ -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{
|
version := &cobra.Command{
|
||||||
Use: "version",
|
Use: "version",
|
||||||
Short: "prints the version to stdout",
|
Short: "prints the version to stdout",
|
||||||
@ -60,6 +69,7 @@ func main() {
|
|||||||
main.AddCommand(shrug)
|
main.AddCommand(shrug)
|
||||||
main.AddCommand(dance)
|
main.AddCommand(dance)
|
||||||
main.AddCommand(claps)
|
main.AddCommand(claps)
|
||||||
|
main.AddCommand(apple)
|
||||||
main.AddCommand(version)
|
main.AddCommand(version)
|
||||||
main.Execute()
|
main.Execute()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user