Skip to content

Commit

Permalink
Use normal color instead of forced white for users who have bright te…
Browse files Browse the repository at this point in the history
…rminal background (minio#2200)
  • Loading branch information
vadmeste authored and harshavardhana committed Jul 13, 2016
1 parent cdf1373 commit 3f27734
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions globals.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,5 @@ var (
colorWhite = color.New(color.FgWhite).SprintfFunc()
colorWhiteBold = color.New(color.FgWhite, color.Bold).SprintfFunc()
colorBlue = color.New(color.FgBlue).SprintfFunc()
colorBold = color.New(color.Bold).SprintFunc()
)
24 changes: 12 additions & 12 deletions server-startup-msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ func printServerCommonMsg(endPoints []string) {

endPointStr := strings.Join(endPoints, " ")
// Colorize the message and print.
console.Println(colorBlue("\nEndpoint: ") + colorWhiteBold(fmt.Sprintf(getFormatStr(len(endPointStr), 1), endPointStr)))
console.Println(colorBlue("AccessKey: ") + colorWhiteBold(fmt.Sprintf("%s ", cred.AccessKeyID)))
console.Println(colorBlue("SecretKey: ") + colorWhiteBold(fmt.Sprintf("%s ", cred.SecretAccessKey)))
console.Println(colorBlue("Region: ") + colorWhiteBold(fmt.Sprintf(getFormatStr(len(region), 3), region)))
console.Println(colorBlue("\nEndpoint: ") + colorBold(fmt.Sprintf(getFormatStr(len(endPointStr), 1), endPointStr)))
console.Println(colorBlue("AccessKey: ") + colorBold(fmt.Sprintf("%s ", cred.AccessKeyID)))
console.Println(colorBlue("SecretKey: ") + colorBold(fmt.Sprintf("%s ", cred.SecretAccessKey)))
console.Println(colorBlue("Region: ") + colorBold(fmt.Sprintf(getFormatStr(len(region), 3), region)))

console.Println(colorBlue("\nBrowser Access:"))
console.Println(colorWhite(fmt.Sprintf(getFormatStr(len(endPointStr), 3), endPointStr)))
console.Println(fmt.Sprintf(getFormatStr(len(endPointStr), 3), endPointStr))
}

// Prints startup message for command line access. Prints link to our documentation
Expand All @@ -72,21 +72,21 @@ func printCLIAccessMsg(endPoint string) {
cred := serverConfig.GetCredential()

// Configure 'mc', following block prints platform specific information for minio client.
console.Println(colorBlue("\nCommand-line Access: ") + colorWhite(mcQuickStartGuide))
console.Println(colorBlue("\nCommand-line Access: ") + mcQuickStartGuide)
if runtime.GOOS == "windows" {
mcMessage := fmt.Sprintf("$ mc.exe config host add myminio %s %s %s", endPoint, cred.AccessKeyID, cred.SecretAccessKey)
console.Println(colorWhite(fmt.Sprintf(getFormatStr(len(mcMessage), 3), mcMessage)))
console.Println(fmt.Sprintf(getFormatStr(len(mcMessage), 3), mcMessage))
} else {
mcMessage := fmt.Sprintf("$ mc config host add myminio %s %s %s", endPoint, cred.AccessKeyID, cred.SecretAccessKey)
console.Println(colorWhite(fmt.Sprintf(getFormatStr(len(mcMessage), 3), mcMessage)))
console.Println(fmt.Sprintf(getFormatStr(len(mcMessage), 3), mcMessage))
}
}

// Prints startup message for Object API acces, prints link to our SDK documentation.
func printObjectAPIMsg() {
console.Println(colorBlue("\nObject API (Amazon S3 compatible):"))
console.Println(colorBlue(" Go: ") + colorWhite(fmt.Sprintf(getFormatStr(len(goQuickStartGuide), 8), goQuickStartGuide)))
console.Println(colorBlue(" Java: ") + colorWhite(fmt.Sprintf(getFormatStr(len(javaQuickStartGuide), 6), javaQuickStartGuide)))
console.Println(colorBlue(" Python: ") + colorWhite(fmt.Sprintf(getFormatStr(len(pyQuickStartGuide), 4), pyQuickStartGuide)))
console.Println(colorBlue(" JavaScript: ") + colorWhite(jsQuickStartGuide))
console.Println(colorBlue(" Go: ") + fmt.Sprintf(getFormatStr(len(goQuickStartGuide), 8), goQuickStartGuide))
console.Println(colorBlue(" Java: ") + fmt.Sprintf(getFormatStr(len(javaQuickStartGuide), 6), javaQuickStartGuide))
console.Println(colorBlue(" Python: ") + fmt.Sprintf(getFormatStr(len(pyQuickStartGuide), 4), pyQuickStartGuide))
console.Println(colorBlue(" JavaScript: ") + jsQuickStartGuide)
}

0 comments on commit 3f27734

Please sign in to comment.