diff --git a/cli/google.go b/cli/google.go index 59a3c29..ec2964b 100644 --- a/cli/google.go +++ b/cli/google.go @@ -10,7 +10,7 @@ func newGoogleCmd() cli.Command { return cli.Command{ Name: "google", Aliases: []string{"g"}, - Usage: "Open GCP resource", + Usage: "Open Google source", Flags: []cli.Flag{ cli.StringFlag{ Name: "project", @@ -18,11 +18,11 @@ func newGoogleCmd() cli.Command { }, }, Action: func(c *cli.Context) error { - gcp, err := google.GetProvider() + g, err := google.GetProvider() if err != nil { return err } - return browser.Open(c, gcp) + return browser.Open(c, g) }, Subcommands: []cli.Command{ newGoogleSearchCmd(), @@ -42,11 +42,11 @@ func newGoogleSearchCmd() cli.Command { }, }, Action: func(c *cli.Context) error { - gcp, err := google.GetProvider() + g, err := google.GetProvider() if err != nil { return err } - return browser.Open(c, gcp) + return browser.Open(c, g) }, } diff --git a/providers/google/google.go b/providers/google/google.go index 7b30365..cedba45 100644 --- a/providers/google/google.go +++ b/providers/google/google.go @@ -41,12 +41,12 @@ func (p *Provider) GetTargetURL() (string, error) { if p.baseURL, err = url.Parse(baseURL); err != nil { return "", err } - p.addProductPath(p.Ctx.Command.Name) return p.URL.String(), nil } func (p *Provider) addProductPath(product string) { + p.URL = p.baseURL switch product { case "search": p.join("search")