Example #1
0
File: main.go Project: dudymas/mc
func setMainPalette(style string) {
	console.SetCustomPalette(map[string]*color.Color{
		"Debug":  color.New(color.FgWhite, color.Faint, color.Italic),
		"Fatal":  color.New(color.FgRed, color.Italic, color.Bold),
		"Error":  color.New(color.FgYellow, color.Italic),
		"Info":   color.New(color.FgGreen, color.Bold),
		"Print":  color.New(),
		"PrintC": color.New(color.FgGreen, color.Bold),
	})
	if style == "light" {
		console.SetCustomPalette(map[string]*color.Color{
			"Debug":  color.New(color.FgWhite, color.Faint, color.Italic),
			"Fatal":  color.New(color.FgWhite, color.Italic, color.Bold),
			"Error":  color.New(color.FgWhite, color.Italic, color.Bold),
			"Info":   color.New(color.FgWhite, color.Bold),
			"Print":  color.New(),
			"PrintC": color.New(color.FgWhite, color.Bold),
		})
		return
	}
	/// Add more styles here
	if style == "nocolor" {
		// All coloring options exhausted, setting nocolor safely
		console.SetNoColor()
	}
}
Example #2
0
func setAccessPalette(style string) {
	console.SetCustomPalette(map[string]*color.Color{
		"Access": color.New(color.FgGreen, color.Bold),
	})
	if style == "light" {
		console.SetCustomPalette(map[string]*color.Color{
			"Access": color.New(color.FgWhite, color.Bold),
		})
	}
	if style == "nocolor" {
		// ALl coloring options exhausted, setting nocolor safely
		console.SetNoColor()
	}
}
Example #3
0
func setMakeBucketPalette(style string) {
	console.SetCustomPalette(map[string]*color.Color{
		"MakeBucket": color.New(color.FgGreen, color.Bold),
	})
	if style == "light" {
		console.SetCustomPalette(map[string]*color.Color{
			"MakeBucket": color.New(color.FgWhite, color.Bold),
		})
		return
	}
	if style == "nocolor" {
		// All coloring options exhausted, setting nocolor safely
		console.SetNoColor()
	}
}
Example #4
0
func setCopyPalette(style string) {
	console.SetCustomPalette(map[string]*color.Color{
		"Copy": color.New(color.FgGreen, color.Bold),
	})
	if style == "light" {
		console.SetCustomPalette(map[string]*color.Color{
			"Copy": color.New(color.FgWhite, color.Bold),
		})
		return
	}
	/// Add more styles here
	if style == "nocolor" {
		// All coloring options exhausted, setting nocolor safely
		console.SetNoColor()
	}
}
Example #5
0
func registerBefore(ctx *cli.Context) error {
	setMcConfigDir(ctx.GlobalString("config-folder"))
	globalQuietFlag = ctx.GlobalBool("quiet")
	globalMimicFlag = ctx.GlobalBool("mimic")
	globalDebugFlag = ctx.GlobalBool("debug")
	globalJSONFlag = ctx.GlobalBool("json")
	if globalDebugFlag {
		console.NoDebugPrint = false
	}
	if ctx.GlobalBool("nocolor") {
		console.SetNoColor()
	}

	verifyMCRuntime()

	// Migrate any old version of config / state files to newer format.
	migrate()

	checkConfig()
	return nil
}
Example #6
0
func setSessionPalette(style string) {
	console.SetCustomPalette(map[string]*color.Color{
		"Command":      color.New(color.FgWhite, color.Bold),
		"SessionID":    color.New(color.FgYellow, color.Bold),
		"SessionTime":  color.New(color.FgGreen),
		"ClearSession": color.New(color.FgGreen, color.Bold),
	})
	if style == "light" {
		console.SetCustomPalette(map[string]*color.Color{
			"Command":      color.New(color.FgWhite, color.Bold),
			"SessionID":    color.New(color.FgWhite, color.Bold),
			"SessionTime":  color.New(color.FgWhite, color.Bold),
			"ClearSession": color.New(color.FgWhite, color.Bold),
		})
		return
	}
	/// Add more styles here
	if style == "nocolor" {
		// All coloring options exhausted, setting nocolor safely
		console.SetNoColor()
	}
}
Example #7
0
func setListPalette(style string) {
	console.SetCustomPalette(map[string]*color.Color{
		"File": color.New(color.FgWhite),
		"Dir":  color.New(color.FgCyan, color.Bold),
		"Size": color.New(color.FgYellow),
		"Time": color.New(color.FgGreen),
	})
	if style == "light" {
		console.SetCustomPalette(map[string]*color.Color{
			"File": color.New(color.FgWhite, color.Bold),
			"Dir":  color.New(color.FgWhite, color.Bold),
			"Size": color.New(color.FgWhite, color.Bold),
			"Time": color.New(color.FgWhite, color.Bold),
		})
		return
	}
	/// Add more styles here
	if style == "nocolor" {
		// All coloring options exhausted, setting nocolor safely
		console.SetNoColor()
	}
}
Example #8
0
func setDiffPalette(style string) {
	console.SetCustomPalette(map[string]*color.Color{
		"DiffMessage":     color.New(color.FgGreen, color.Bold),
		"DiffOnlyInFirst": color.New(color.FgRed, color.Bold),
		"DiffType":        color.New(color.FgYellow, color.Bold),
		"DiffSize":        color.New(color.FgMagenta, color.Bold),
	})
	if style == "light" {
		console.SetCustomPalette(map[string]*color.Color{
			"DiffMessage":     color.New(color.FgWhite, color.Bold),
			"DiffOnlyInFirst": color.New(color.FgWhite, color.Bold),
			"DiffType":        color.New(color.FgWhite, color.Bold),
			"DiffSize":        color.New(color.FgWhite, color.Bold),
		})
		return
	}
	/// Add more styles here
	if style == "nocolor" {
		// All coloring options exhausted, setting nocolor safely
		console.SetNoColor()
	}
}
Example #9
0
File: share.go Project: dudymas/mc
func setSharePalette(style string) {
	console.SetCustomPalette(map[string]*color.Color{
		"Share":   color.New(color.FgGreen, color.Bold),
		"Expires": color.New(color.FgRed, color.Bold),
		"URL":     color.New(color.FgCyan, color.Bold),
		"File":    color.New(color.FgRed, color.Bold),
	})
	if style == "light" {
		console.SetCustomPalette(map[string]*color.Color{
			"Share":   color.New(color.FgWhite, color.Bold),
			"Expires": color.New(color.FgWhite, color.Bold),
			"URL":     color.New(color.FgWhite, color.Bold),
			"File":    color.New(color.FgWhite, color.Bold),
		})
		return
	}
	/// Add more styles here

	if style == "nocolor" {
		// All coloring options exhausted, setting nocolor safely
		console.SetNoColor()
	}
}
Example #10
0
func setConfigHostPalette(style string) {
	console.SetCustomPalette(map[string]*color.Color{
		"Host":            color.New(color.FgCyan, color.Bold),
		"API":             color.New(color.FgYellow, color.Bold),
		"HostMessage":     color.New(color.FgGreen, color.Bold),
		"AccessKeyID":     color.New(color.FgBlue, color.Bold),
		"SecretAccessKey": color.New(color.FgRed, color.Bold),
	})
	if style == "light" {
		console.SetCustomPalette(map[string]*color.Color{
			"Host":            color.New(color.FgWhite, color.Bold),
			"API":             color.New(color.FgWhite, color.Bold),
			"HostMessage":     color.New(color.FgWhite, color.Bold),
			"AccessKeyID":     color.New(color.FgWhite, color.Bold),
			"SecretAccessKey": color.New(color.FgWhite, color.Bold),
		})
		return
	}
	/// Add more styles here
	if style == "nocolor" {
		// All coloring options exhausted, setting nocolor safely
		console.SetNoColor()
	}
}