We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d5da5f commit 8eed836Copy full SHA for 8eed836
main.go
@@ -10,6 +10,7 @@ import (
10
"github.com/gdamore/tcell/encoding"
11
"github.com/sachaos/go-life/preset"
12
"github.com/urfave/cli"
13
+ "log"
14
)
15
16
func initScreen() tcell.Screen {
@@ -95,6 +96,25 @@ func main() {
95
96
app.Usage = "Conway's Game of Life"
97
app.Version = "0.2.0"
98
99
+ app.Flags = []cli.Flag{
100
+ cli.BoolFlag{
101
+ Name: "debug",
102
+ },
103
+ }
104
+
105
+ app.Before = func(c *cli.Context) error {
106
+ if c.Bool("debug") {
107
+ log.SetOutput(os.Stderr)
108
+ } else {
109
+ file, err := os.Open(os.DevNull)
110
+ if err != nil {
111
+ return err
112
113
+ log.SetOutput(file)
114
115
+ return nil
116
117
118
app.Commands = []cli.Command{
119
{
120
Name: "themes",
0 commit comments