diff options
Diffstat (limited to 'hi.go')
| -rw-r--r-- | hi.go | 19 |
1 files changed, 7 insertions, 12 deletions
@@ -9,18 +9,6 @@ import ( "strings" ) -func init() { - highlightColor = red - flag.Var((*colorFlag)(&highlightColor), "c", fmt.Sprintf("highlight `color` %s", colorsChoices)) - background = defaultColor - flag.Var((*colorFlag)(&background), "bg", fmt.Sprintf("background `color` default|%s", colorsChoices)) -} - -var ( - highlightColor ansiColor - background ansiColor -) - //go:generate stringer -type=ansiColor -linecomment type ansiColor int @@ -87,6 +75,11 @@ func (c *colorFlag) String() string { return ansiColor(*c).String() } +var ( + highlightColor = red + background = defaultColor +) + func run() error { args := flag.Args() if len(args) == 0 { @@ -132,6 +125,8 @@ Examples: `) os.Exit(2) } + flag.Var((*colorFlag)(&highlightColor), "c", fmt.Sprintf("highlight `color` %s", colorsChoices)) + flag.Var((*colorFlag)(&background), "bg", fmt.Sprintf("background `color` default|%s", colorsChoices)) flag.Parse() if err := run(); err != nil { fmt.Fprintf(os.Stderr, "hi: %s\n", err) |
