@@ -92,43 +92,43 @@ func printTable(out io.Writer, appInfo appInfo) error {
9292 for _ , service := range appInfo .Services {
9393 fmt .Fprintf (w , "%s\t %d\t %s\t %s\n " , service .Name , service .Replicas , service .Ports , service .Image )
9494 }
95- }, "Service " , "Replicas " , "Ports " , "Image " )
95+ }, "SERVICE " , "REPLICAS " , "PORTS " , "IMAGE " )
9696
9797 // Add Network section
9898 printSection (out , len (appInfo .Networks ), func (w io.Writer ) {
9999 for _ , name := range appInfo .Networks {
100100 fmt .Fprintln (w , name )
101101 }
102- }, "Network " )
102+ }, "NETWORK " )
103103
104104 // Add Volume section
105105 printSection (out , len (appInfo .Volumes ), func (w io.Writer ) {
106106 for _ , name := range appInfo .Volumes {
107107 fmt .Fprintln (w , name )
108108 }
109- }, "Volume " )
109+ }, "VOLUME " )
110110
111111 // Add Secret section
112112 printSection (out , len (appInfo .Secrets ), func (w io.Writer ) {
113113 for _ , name := range appInfo .Secrets {
114114 fmt .Fprintln (w , name )
115115 }
116- }, "Secret " )
116+ }, "SECRET " )
117117
118118 // Add Parameter section
119119 printSection (out , len (appInfo .parametersKeys ), func (w io.Writer ) {
120120 for _ , k := range appInfo .parametersKeys {
121121 fmt .Fprintf (w , "%s\t %s\n " , k , appInfo .Parameters [k ])
122122 }
123- }, "Parameter " , "Value " )
123+ }, "PARAMETER " , "VALUE " )
124124
125125 // Add Attachments section
126126 printSection (out , len (appInfo .Attachments ), func (w io.Writer ) {
127127 for _ , attachment := range appInfo .Attachments {
128128 sizeString := units .HumanSize (float64 (attachment .Size ))
129129 fmt .Fprintf (w , "%s\t %s\n " , attachment .Path , sizeString )
130130 }
131- }, "Attachment " , "Size " )
131+ }, "ATTACHMENT " , "SIZE " )
132132 return nil
133133}
134134
@@ -146,25 +146,11 @@ func printSection(out io.Writer, len int, printer func(io.Writer), headers ...st
146146 }
147147 fmt .Fprintln (out )
148148 w := tabwriter .NewWriter (out , 0 , 0 , 1 , ' ' , 0 )
149- var plural string
150- if len > 1 {
151- plural = "s"
152- }
153- headers [0 ] = fmt .Sprintf ("%s%s (%d)" , headers [0 ], plural , len )
154- printHeaders (w , headers ... )
149+ fmt .Fprintln (w , strings .Join (headers , "\t " ))
155150 printer (w )
156151 w .Flush ()
157152}
158153
159- func printHeaders (w io.Writer , headers ... string ) {
160- fmt .Fprintln (w , strings .Join (headers , "\t " ))
161- dashes := make ([]string , len (headers ))
162- for i , h := range headers {
163- dashes [i ] = strings .Repeat ("-" , len (h ))
164- }
165- fmt .Fprintln (w , strings .Join (dashes , "\t " ))
166- }
167-
168154func getAppInfo (app * types.App , config * composetypes.Config , argParameters map [string ]string ) (appInfo , error ) {
169155 services := []service {}
170156 for _ , s := range config .Services {
0 commit comments