Browse Source

Adds apple subcommand

Stephen McQuay 5 months ago
parent
commit
d96e4ec394
Signed by: Stephen McQuay <stephen@mcquay.me> GPG Key ID: C383C74875475AC8
2 changed files with 30 additions and 0 deletions
  1. 20
    0
      apple.go
  2. 10
    0
      cmd/yay/main.go

+ 20
- 0
apple.go View File

@@ -0,0 +1,20 @@
1
+package yay
2
+
3
+type Apple struct {
4
+	Sequence
5
+}
6
+
7
+func NewApple() *Apple {
8
+	return &Apple{
9
+		Sequence{
10
+			Frames: [][]rune{
11
+				[]rune(`   `),
12
+				[]rune(`   `),
13
+				[]rune(`   `),
14
+				[]rune(`   `),
15
+				[]rune(`   `),
16
+				[]rune(`   `),
17
+			},
18
+		},
19
+	}
20
+}

+ 10
- 0
cmd/yay/main.go View File

@@ -50,6 +50,15 @@ func main() {
50 50
 		},
51 51
 	}
52 52
 
53
+	apple := &cobra.Command{
54
+		Use:   "apple",
55
+		Short: "Go Apple, Go!",
56
+		Run: func(cmd *cobra.Command, args []string) {
57
+			t := yay.NewViewPort(yay.NewApple(), time.Duration(frameRate)*time.Millisecond)
58
+			t.Run()
59
+		},
60
+	}
61
+
53 62
 	version := &cobra.Command{
54 63
 		Use:   "version",
55 64
 		Short: "prints the version to stdout",
@@ -60,6 +69,7 @@ func main() {
60 69
 	main.AddCommand(shrug)
61 70
 	main.AddCommand(dance)
62 71
 	main.AddCommand(claps)
72
+	main.AddCommand(apple)
63 73
 	main.AddCommand(version)
64 74
 	main.Execute()
65 75
 }

Loading…
Cancel
Save