Skip to content

Commit

Permalink
Add ability to force colors (for Windows)
Browse files Browse the repository at this point in the history
  • Loading branch information
dperny committed Jan 20, 2021
1 parent 4e1d450 commit 61bcac9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Binary file modified bta-wiki-import.exe
Binary file not shown.
14 changes: 14 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
package cmd

import (
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)

var (
flagColor bool
)

var RootCmd = &cobra.Command{
Use: "btawiki",
Short: "btawiki exports data from BTA3062 game files to mediawiki",
PersistentPreRun: func(cmd *cobra.Command, _ []string) {
if flagColor {
logrus.SetFormatter(&logrus.TextFormatter{ForceColors: true})
}
},
}

func init() {
RootCmd.PersistentFlags().BoolVar(&flagColor, "color", false, "enable color logging")
}

0 comments on commit 61bcac9

Please sign in to comment.