This commit is contained in:
25
src/mfer.go
25
src/mfer.go
@@ -15,18 +15,37 @@ func printBanner(Appname, Version, Buildarch string) {
|
||||
pterm.DefaultCenter.Println(s) // Print BigLetters with the default CenterPrinter
|
||||
}
|
||||
|
||||
func disableStyling() {
|
||||
pterm.DisableColor()
|
||||
pterm.DisableStyling()
|
||||
pterm.Debug.Prefix.Text = ""
|
||||
pterm.Info.Prefix.Text = ""
|
||||
pterm.Success.Prefix.Text = ""
|
||||
pterm.Warning.Prefix.Text = ""
|
||||
pterm.Error.Prefix.Text = ""
|
||||
pterm.Fatal.Prefix.Text = ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
if _, exists := os.LookupEnv("NO_COLOR"); exists {
|
||||
disableStyling()
|
||||
}
|
||||
}
|
||||
|
||||
func Run(Appname, Version, Buildarch string) int {
|
||||
printBanner(Appname, Version, Buildarch)
|
||||
app := &cli.App{
|
||||
Name: Appname,
|
||||
Usage: "Manifest generator",
|
||||
Name: Appname,
|
||||
Usage: "Manifest generator",
|
||||
Version: Version,
|
||||
EnableBashCompletion: true,
|
||||
Commands: []*cli.Command{
|
||||
{
|
||||
Name: "generate",
|
||||
Aliases: []string{"gen"},
|
||||
Usage: "Generate manifest file",
|
||||
Action: func(c *cli.Context) error {
|
||||
return generateManifest(".", "./index.mf")
|
||||
return generateManifest(c.String("input"), c.String("output"))
|
||||
},
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
|
||||
Reference in New Issue
Block a user