Fix flag parse error by calling flag.Parse first (#42)

* Fix flag parse error by calling flag.Parse

Fixes https://github.com/knative/client/issues/37

* Fix workaround for parse error
This commit is contained in:
Kenjiro Nakayama 2019-03-29 20:34:53 +09:00 committed by Knative Prow Robot
parent a68d11e9b2
commit 72ec64390b
1 changed files with 4 additions and 0 deletions

View File

@ -15,6 +15,7 @@
package commands package commands
import ( import (
"flag"
"fmt" "fmt"
"io" "io"
"os" "os"
@ -73,6 +74,9 @@ Eventing: Manage event subscriptions and channels. Connect up event sources.`,
rootCmd.AddCommand(NewServiceCommand(p)) rootCmd.AddCommand(NewServiceCommand(p))
rootCmd.AddCommand(NewRevisionCommand(p)) rootCmd.AddCommand(NewRevisionCommand(p))
rootCmd.AddCommand(NewCompletionCommand(p)) rootCmd.AddCommand(NewCompletionCommand(p))
// For glog parse error.
flag.CommandLine.Parse([]string{})
return rootCmd return rootCmd
} }