File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
content/manuals/engine/cli Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,26 @@ $ docker inspect --format "{{title .Name}}" container
9090$ docker inspect --format " {{upper .Name}}" container
9191```
9292
93+ ## pad
94+
95+ ` pad ` adds whitespace padding to a string. You can specify the number of spaces to add before and after the string.
96+
97+ ``` console
98+ $ docker image list --format ' {{pad .Repository 5 10}}'
99+ ```
100+
101+ This example will add 5 spaces before the image repository name and 10 spaces after.
102+
103+ ## truncate
104+
105+ ` truncate ` shortens a string to a specified length. If the string is shorter than the specified length, it remains unchanged.
106+
107+ ``` console
108+ $ docker image list --format ' {{truncate .Repository 15}}'
109+ ```
110+
111+ This example will display the image repository name, truncating it to the first 15 characters if it's longer.
112+
93113## println
94114
95115` println ` prints each value on a new line.
You can’t perform that action at this time.
0 commit comments