Usability improvements

pull/6/head
Daniel Smith 2014-06-12 14:13:02 -07:00
parent 853a4e26a8
commit 74fd0c1a58
1 changed files with 4 additions and 2 deletions

View File

@ -25,6 +25,7 @@ import (
"os" "os"
"path" "path"
"strconv" "strconv"
"strings"
"time" "time"
kube_client "github.com/GoogleCloudPlatform/kubernetes/pkg/client" kube_client "github.com/GoogleCloudPlatform/kubernetes/pkg/client"
@ -64,6 +65,7 @@ func readConfig(storage string) []byte {
if err != nil { if err != nil {
log.Fatalf("Error parsing %v as an object for %v: %#v\n", *config, storage, err) log.Fatalf("Error parsing %v as an object for %v: %#v\n", *config, storage, err)
} }
log.Printf("Parsed config file successfully; sending:\n%v\n", string(data))
return data return data
} }
@ -88,7 +90,7 @@ func main() {
if parsedUrl.Scheme != "" && parsedUrl.Scheme != "https" { if parsedUrl.Scheme != "" && parsedUrl.Scheme != "https" {
secure = false secure = false
} }
storage := flag.Arg(1) storage := strings.Trim(flag.Arg(1), "/")
url := *httpServer + path.Join("/api/v1beta1", storage) url := *httpServer + path.Join("/api/v1beta1", storage)
var request *http.Request var request *http.Request
@ -167,7 +169,7 @@ func main() {
} }
err = printer.Print(body, os.Stdout) err = printer.Print(body, os.Stdout)
if err != nil { if err != nil {
log.Fatalf("Failed to print: %#v", err) log.Fatalf("Failed to print: %#v\nRaw received text:\n%v\n", err, string(body))
} }
fmt.Print("\n") fmt.Print("\n")
} }