Just an observation - not sure if many people find this a niggle, but I often have IPv6 privacy addresses configured on containers, and these end up generating very wide output with the default lxd list
formatting: e.g. to give the first line of output on the host I’m currently administering:
+------------------+---------+------------------------+-----------------------------------------------+-----------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------------------+---------+------------------------+-----------------------------------------------+-----------+-----------+
| apt-proxy | RUNNING | 192.168.145.182 (eth1) | 2a12:17a1:1:a421:6ad0:b231:abc3:df7f (ethPub) | CONTAINER | 0 |
+------------------+---------+------------------------+-----------------------------------------------+-----------+-----------+
I had a few ideas that might be useful to shrink the output…
I was wondering if it might be better to default to combining IPv4 and IPv6 addresses into a single column (e.g. by adding another column key which combines both):
+------------------+---------+-----------------------------------------------+-----------+-----------+
| NAME | STATE | IP | TYPE | SNAPSHOTS |
+------------------+---------+-----------------------------------------------+-----------+-----------+
| apt-proxy | RUNNING | 192.168.145.182 (eth1) | CONTAINER | 0 |
| | | 2a12:17a1:1:a421:6ad0:b231:abc3:df7f (ethPub) | | |
+------------------+---------+-----------------------------------------------+-----------+-----------+
Looking at other possible easy wins to reduce the width, perhaps the column heading for SNAPSHOTS could be smaller in the default (lxd list
without custom format options) output, e.g.:
+------------------+---------+-----------------------------------------------+-----------+-------+
| NAME | STATE | IP | TYPE | SNAPS |
+------------------+---------+-----------------------------------------------+-----------+-------+
| apt-proxy | RUNNING | 192.168.145.182 (eth1) | CONTAINER | 0 |
| | | 2a12:17a1:1:a421:6ad0:b231:abc3:df7f (ethPub) | | |
+------------------+---------+-----------------------------------------------+-----------+-------+
Or perhaps the column could be omitted entirely if all containers have 0 snapshots:
+------------------+---------+-----------------------------------------------+-----------+
| NAME | STATE | IP | TYPE |
+------------------+---------+-----------------------------------------------+-----------+
| apt-proxy | RUNNING | 192.168.145.182 (eth1) | CONTAINER |
| | | 2a12:17a1:1:a421:6ad0:b231:abc3:df7f (ethPub) | |
+------------------+---------+-----------------------------------------------+-----------+
Similarly perhaps TYPE
could be automatically omitted if all containers are of the same type (e.g. if all are containers):
+------------------+---------+-----------------------------------------------+
| NAME | STATE | IP |
+------------------+---------+-----------------------------------------------+
| apt-proxy | RUNNING | 192.168.145.182 (eth1) |
| | | 2a12:17a1:1:a421:6ad0:b231:abc3:df7f (ethPub) |
+------------------+---------+-----------------------------------------------+
… the last example is 78 characters wide - which is a 38% width saving over the current output.
Perhaps some of this combining or hiding of columns could also be made automatic based on terminal width?