From 4e4ccbe2e85ac21ccd9e3a9e65b58638841c425a Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Mon, 22 Jul 2019 13:24:09 -0400 Subject: [PATCH] Don't default host to Write.as in wf-cli We want to keep wf-cli service-agnostic and to make sure there's no confusing overlap between this client and writeas-cli. Ref T586 --- api/api.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/api.go b/api/api.go index b60d9c1..8fac589 100644 --- a/api/api.go +++ b/api/api.go @@ -38,8 +38,10 @@ func newClient(c *cli.Context, authRequired bool) (*writeas.Client, error) { clientConfig.URL = cfg.Default.Host + "/api" } else if config.IsDev() { clientConfig.URL = config.DevBaseURL + "/api" - } else { + } else if c.App.Name == "writeas" { clientConfig.URL = config.WriteasBaseURL + "/api" + } else { + return nil, fmt.Errorf("Must supply a host. Example: %s --host example.com %s", executable.Name(), c.Command.Name) } if config.IsTor(c) { clientConfig.URL = config.TorURL(c)