@@ -79,13 +79,21 @@ func runList(cmd *cobra.Command, args []string) error {
79
79
fmt .Printf ("%s\n " , function .Name )
80
80
}
81
81
} else if verboseList {
82
- fmt .Printf ("%-30s\t %-40s\t %-15s\t %-5s\n " , "Function" , "Image" , "Invocations" , "Replicas" )
82
+
83
+ maxWidth := 40
83
84
for _ , function := range functions {
84
- functionImage := function .Image
85
- if len (function .Image ) > 40 {
86
- functionImage = functionImage [0 :38 ] + ".."
85
+ if len (function .Image ) > maxWidth {
86
+ maxWidth = len (function .Image )
87
87
}
88
- fmt .Printf ("%-30s\t %-40s\t %-15d\t %-5d\n " , function .Name , functionImage , int64 (function .InvocationCount ), function .Replicas )
88
+ }
89
+
90
+ fmt .Printf ("%-30s\t %-" + fmt .Sprintf ("%d" , maxWidth )+ "s\t %-15s\t %-5s\n " , "Function" , "Image" , "Invocations" , "Replicas" )
91
+ for _ , function := range functions {
92
+ functionImage := function .Image
93
+ // if len(function.Image) > 40 {
94
+ // functionImage = functionImage[0:38] + ".."
95
+ // }
96
+ fmt .Printf ("%-30s\t %-" + fmt .Sprintf ("%d" , maxWidth )+ "s\t %-15d\t %-5d\n " , function .Name , functionImage , int64 (function .InvocationCount ), function .Replicas )
89
97
}
90
98
} else {
91
99
fmt .Printf ("%-30s\t %-15s\t %-5s\n " , "Function" , "Invocations" , "Replicas" )
0 commit comments