diff --git a/share-upload-main.go b/share-upload-main.go index 00037c15..c87b7131 100644 --- a/share-upload-main.go +++ b/share-upload-main.go @@ -23,7 +23,6 @@ import ( "github.com/minio/cli" "github.com/minio/mc/pkg/client" - "github.com/minio/mc/pkg/console" "github.com/minio/minio-xl/pkg/probe" ) @@ -103,18 +102,18 @@ func makeCurlCmd(key string, uploadInfo map[string]string) string { if !isBucketVirtualStyle(URL.Host) { postURL = postURL + uploadInfo["bucket"] } - postURL = postURL + " " + postURL += " " curlCommand := "curl " + postURL for k, v := range uploadInfo { if k == "key" { key = v continue } - curlCommand = curlCommand + fmt.Sprintf("-F %s=%s ", k, v) + curlCommand += fmt.Sprintf("-F %s=%s ", k, v) } - curlCommand = curlCommand + fmt.Sprintf("-F key=%s ", key) + "-F file=@ " - emphasize := console.Colorize("File", "") - return strings.Replace(curlCommand, "", emphasize, -1) + curlCommand += fmt.Sprintf("-F key=%s ", key) // Object name. + curlCommand += "-F file=@" // File to upload. + return curlCommand } // save shared URL to disk. diff --git a/share.go b/share.go index 063e2f59..3894be2e 100644 --- a/share.go +++ b/share.go @@ -22,6 +22,7 @@ import ( "fmt" "os" "path/filepath" + "strings" "time" "github.com/fatih/color" @@ -64,9 +65,12 @@ func (s shareMesssage) String() string { if s.ContentType != "" { msg += console.Colorize("Content-type", fmt.Sprintf("Content-Type: %s\n", s.ContentType)) } - msg += console.Colorize("Share", fmt.Sprintf("Share: %s\n", s.ShareURL)) - return msg // + "\n" // Separate each entry with a new-line. + // Highlight specially. "share upload" sub-commands uses this identifier. + shareURL := strings.Replace(s.ShareURL, "", console.Colorize("File", ""), 1) + msg += console.Colorize("Share", fmt.Sprintf("Share: %s\n", shareURL)) + + return msg } // JSON - JSONified message for scripting.