本文整理匯總了Golang中github.com/minio/mc/pkg/console.SetNoColor函數的典型用法代碼示例。如果您正苦於以下問題:Golang SetNoColor函數的具體用法?Golang SetNoColor怎麽用?Golang SetNoColor使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了SetNoColor函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: setMainPalette
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: setAccessPalette
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: setMakeBucketPalette
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: setCopyPalette
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: registerBefore
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: setSessionPalette
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: setListPalette
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: setDiffPalette
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: setSharePalette
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: setConfigHostPalette
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()
}
}