forked from dperny/bta-wiki-import
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to force colors (for Windows)
- Loading branch information
Showing
2 changed files
with
14 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
} |