From 91674820f21c99549ae77bbf23a3f8ae2550d671 Mon Sep 17 00:00:00 2001 From: Denis Makogon Date: Thu, 6 Jul 2017 18:44:38 +0300 Subject: [PATCH] Fixing tab writer for more clean view while listing routes --- fn/routes.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fn/routes.go b/fn/routes.go index 63fec0147..13d63f5a7 100644 --- a/fn/routes.go +++ b/fn/routes.go @@ -168,16 +168,15 @@ func (a *routesCmd) list(c *cli.Context) error { return fmt.Errorf("unexpected error: %s", err) } - w := tabwriter.NewWriter(os.Stdout, 0, 8, 0, '\t', 0) + w := tabwriter.NewWriter(os.Stdout, 0, 8, 1, '\t', 0) fmt.Fprint(w, "path", "\t", "image", "\t", "endpoint", "\n") for _, route := range resp.Payload.Routes { - u, err := url.Parse("../") - u.Path = path.Join(u.Path, "r", appName, route.Path) + endpoint := path.Join(client.Host(), "r", appName, route.Path) if err != nil { return fmt.Errorf("error parsing functions route path: %s", err) } - fmt.Fprint(w, route.Path, "\t", route.Image, "\n") + fmt.Fprint(w, route.Path, "\t", route.Image, "\t", endpoint, "\n") } w.Flush()