Merge pull request #569 from harshavardhana/pr_out_add_documentation_for_update_and_use_pathstyle_for_play_minio_io_for_now
This commit is contained in:
+20
-6
@@ -245,22 +245,36 @@ EXAMPLES:
|
||||
|
||||
USAGE:
|
||||
mc {{.Name}}{{if .Flags}} [ARGS...]{{end}} generate
|
||||
mc {{.Name}}{{if .Flags}} [ARGS...]{{end}} alias NAME:HOSTURL
|
||||
mc {{.Name}}{{if .Flags}} [ARGS...]{{end}} alias NAME HOSTURL
|
||||
|
||||
EXAMPLES:
|
||||
1. Generate mc config
|
||||
$ mc config generate
|
||||
|
||||
2. Add alias URLs
|
||||
$ mc config alias zek:https://s3.amazonaws.com/
|
||||
$ mc config alias zek https://s3.amazonaws.com/
|
||||
|
||||
`,
|
||||
}
|
||||
updateCmd = cli.Command{
|
||||
Name: "update",
|
||||
Usage: "Check for new software updates",
|
||||
Description: "",
|
||||
Action: runUpdateCmd,
|
||||
Name: "update",
|
||||
Usage: "Check for new software updates",
|
||||
Action: runUpdateCmd,
|
||||
CustomHelpTemplate: `Name:
|
||||
mc {{.Name}} - {{.Usage}}
|
||||
|
||||
USAGE:
|
||||
mc {{.Name}}{{if .Flags}} [ARGS...]{{end}} check
|
||||
mc {{.Name}}{{if .Flags}} [ARGS...]{{end}} yes
|
||||
|
||||
EXAMPLES:
|
||||
1. Check for new updates
|
||||
$ mc update check
|
||||
|
||||
2. Download new minio client locally and update
|
||||
$ mc update yes
|
||||
|
||||
`,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -102,9 +102,7 @@ func main() {
|
||||
} else {
|
||||
log.Debug = log.New(ioutil.Discard, "", 0)
|
||||
}
|
||||
|
||||
themeName := ctx.GlobalString("theme")
|
||||
|
||||
if console.IsValidTheme(themeName) {
|
||||
err := console.SetTheme(themeName)
|
||||
if err != nil {
|
||||
@@ -117,7 +115,7 @@ func main() {
|
||||
return nil
|
||||
}
|
||||
app.After = func(ctx *cli.Context) error {
|
||||
if !isMcConfigExist() && ctx.Command.Name != "config" {
|
||||
if !isMcConfigExist() {
|
||||
console.Fatalln("\"mc\" is not configured. Please run \"mc config generate\".")
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -123,8 +123,11 @@ func (c *s3Client) bucketURL(bucket string) string {
|
||||
if net.ParseIP(host) != nil {
|
||||
return fmt.Sprintf("%s://%s/%s", c.Scheme, c.Host, bucket)
|
||||
}
|
||||
// For DNS hostname or amazonaws.com use subdomain style
|
||||
url = fmt.Sprintf("%s://%s.%s/", c.Scheme, bucket, c.Host)
|
||||
if strings.Contains(c.Host, "amazonaws.com") {
|
||||
// amazonaws.com use subdomain style
|
||||
return fmt.Sprintf("%s://%s.%s/", c.Scheme, bucket, c.Host)
|
||||
}
|
||||
url = fmt.Sprintf("%s://%s/%s", c.Scheme, c.Host, bucket)
|
||||
}
|
||||
return url
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user