File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ package cmd
19
19
import (
20
20
"fmt"
21
21
"os"
22
+ "path/filepath"
23
+ "strings"
22
24
23
25
"github.com/pkg/errors"
24
26
"github.com/spf13/cobra"
@@ -151,10 +153,15 @@ func runGetComponents() error {
151
153
func printComponents (c client.Components , output string ) error {
152
154
switch output {
153
155
case ComponentsOutputText :
156
+ dir , file := filepath .Split (c .URL ())
157
+ // Remove the version suffix from the URL since we already display it
158
+ // separately.
159
+ baseURL , _ := filepath .Split (strings .TrimSuffix (dir , "/" ))
154
160
fmt .Printf ("Name: %s\n " , c .Name ())
155
161
fmt .Printf ("Type: %s\n " , c .Type ())
156
- fmt .Printf ("URL: %s\n " , c . URL () )
162
+ fmt .Printf ("URL: %s\n " , baseURL )
157
163
fmt .Printf ("Version: %s\n " , c .Version ())
164
+ fmt .Printf ("File: %s\n " , file )
158
165
fmt .Printf ("TargetNamespace: %s\n " , c .TargetNamespace ())
159
166
fmt .Printf ("WatchingNamespace: %s\n " , c .WatchingNamespace ())
160
167
if len (c .Variables ()) > 0 {
You can’t perform that action at this time.
0 commit comments