feat(debug): add debug flag

pull/291/head
Adam Reese 10 years ago
parent 4fc6a7b6c0
commit fe60ff17c1

@ -8,6 +8,7 @@ import (
) )
var version = "0.0.1" var version = "0.0.1"
var isDebugging bool
func main() { func main() {
app := cli.NewApp() app := cli.NewApp()
@ -24,6 +25,15 @@ func main() {
EnvVar: "HELM_HOST", EnvVar: "HELM_HOST",
Value: "https://localhost:8181/FIXME_NOT_RIGHT", Value: "https://localhost:8181/FIXME_NOT_RIGHT",
}, },
cli.BoolFlag{
Name: "debug",
Usage: "Enable verbose debugging output",
},
}
app.Before = func(ctx *cli.Context) error {
isDebugging = ctx.Bool("debug")
return nil
} }
app.Run(os.Args) app.Run(os.Args)

@ -23,7 +23,7 @@ func listCmd() cli.Command {
} }
func list(host string) error { func list(host string) error {
client := dm.NewClient(host).SetDebug(true) client := dm.NewClient(host).SetDebug(isDebugging)
list, err := client.ListDeployments() list, err := client.ListDeployments()
if err != nil { if err != nil {
return err return err

Loading…
Cancel
Save