mfer/internal/cli/entry.go

26 lines
330 B
Go
Raw Normal View History

2022-12-02 00:31:49 +00:00
package cli
2022-02-02 05:36:20 +00:00
import (
"os"
)
2022-02-02 09:46:25 +00:00
var NO_COLOR bool
2022-02-02 06:39:50 +00:00
func init() {
2022-02-02 09:46:25 +00:00
NO_COLOR = false
2022-02-02 06:39:50 +00:00
if _, exists := os.LookupEnv("NO_COLOR"); exists {
2022-02-02 09:46:25 +00:00
NO_COLOR = true
2022-02-02 06:39:50 +00:00
}
}
2022-12-04 00:33:24 +00:00
func Run(Appname, Version, Gitrev string) int {
2022-12-02 00:31:49 +00:00
m := &CLIApp{}
2022-02-02 09:46:25 +00:00
m.appname = Appname
m.version = Version
2022-12-04 00:33:24 +00:00
m.gitrev = Gitrev
2022-02-02 09:46:25 +00:00
m.exitCode = 0
m.run()
return m.exitCode
2022-02-02 05:36:20 +00:00
}