File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ require (
10
10
github.com/mattn/go-runewidth v0.0.3 // indirect
11
11
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d // indirect
12
12
github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a // indirect
13
+ github.com/urfave/cli v1.20.0
13
14
golang.org/x/text v0.3.0 // indirect
14
15
gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0 // indirect
15
16
)
Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ github.com/spf13/pflag v1.0.2 h1:Fy0orTDgHdbnzHcsOgfCN4LtHf0ec3wwtiwJqwvf3Gc=
29
29
github.com/spf13/pflag v1.0.2 /go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4 =
30
30
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w =
31
31
github.com/stretchr/testify v1.2.2 /go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs =
32
+ github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw =
33
+ github.com/urfave/cli v1.20.0 /go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA =
32
34
golang.org/x/net v0.0.0-20180921000356-2f5d2388922f h1:QM2QVxvDoW9PFSPp/zy9FgxJLfaWTZlS61KEPtBwacM =
33
35
golang.org/x/net v0.0.0-20180921000356-2f5d2388922f /go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4 =
34
36
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA =
Original file line number Diff line number Diff line change 9
9
"github.com/gdamore/tcell"
10
10
"github.com/gdamore/tcell/encoding"
11
11
"github.com/sachaos/go-life/preset"
12
+ "github.com/urfave/cli"
12
13
)
13
14
14
15
func initScreen () tcell.Screen {
@@ -75,7 +76,16 @@ func main() {
75
76
ThemeWhiteAndBlack ,
76
77
}
77
78
78
- if err := startGame (themes , presets ); err != nil {
79
+ app := cli .NewApp ()
80
+ app .Name = "go-life"
81
+ app .Usage = "Conway's Game of Life"
82
+ app .Version = "0.2.0"
83
+
84
+ app .Action = func (c * cli.Context ) error {
85
+ return startGame (themes , presets )
86
+ }
87
+
88
+ if err := app .Run (os .Args ); err != nil {
79
89
fmt .Fprintf (os .Stderr , err .Error ())
80
90
os .Exit (1 )
81
91
}
You can’t perform that action at this time.
0 commit comments