mfer/internal/cli/cli.go

25 lines
303 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-02 00:31:49 +00:00
func Run(Appname, Version string) int {
m := &CLIApp{}
2022-02-02 09:46:25 +00:00
m.appname = Appname
m.version = Version
m.exitCode = 0
m.run()
return m.exitCode
2022-02-02 05:36:20 +00:00
}