コード例 #1
0
ファイル: main.go プロジェクト: 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()
	}
}
コード例 #2
0
ファイル: access-main.go プロジェクト: henrylee2cn/mc
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()
	}
}
コード例 #3
0
ファイル: mb-main.go プロジェクト: henrylee2cn/mc
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()
	}
}
コード例 #4
0
ファイル: cp-main.go プロジェクト: dudymas/mc
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()
	}
}
コード例 #5
0
ファイル: main.go プロジェクト: axcoto-lab/mc
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
}
コード例 #6
0
ファイル: session-main.go プロジェクト: henrylee2cn/mc
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()
	}
}
コード例 #7
0
ファイル: ls-main.go プロジェクト: henrylee2cn/mc
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()
	}
}
コード例 #8
0
ファイル: diff-main.go プロジェクト: henrylee2cn/mc
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()
	}
}
コード例 #9
0
ファイル: share.go プロジェクト: 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()
	}
}
コード例 #10
0
ファイル: config-host-main.go プロジェクト: dudymas/mc
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()
	}
}