On the help message for incus image list
it contains for the column shorthand chars the following description.
Column shorthand chars:
l - Shortest image alias (and optionally number of other aliases)
L - Newline-separated list of all image aliases
f - Fingerprint (short)
F - Fingerprint (long)
p - Whether image is public
d - Description
e - Project
a - Architecture
s - Size
u - Upload date
t - Type
What got me interested was in the l - Shortest image alias (and optionally number of other aliases)
. I tried to add l2
, l-2
or l(2)
and could not get it to print something related to “a number of other aliases”. Trying to look for this in the incus code, I found the parseColumns
function in cmd/incus/image.go
file which seems to process the input and I didn’t find anything related to processing that number.
func (c *cmdImageList) parseColumns() ([]imageColumn, error) {
columnsShorthandMap := map[rune]imageColumn{
'a': {i18n.G("ARCHITECTURE"), c.architectureColumnData},
'd': {i18n.G("DESCRIPTION"), c.descriptionColumnData},
'e': {i18n.G("PROJECT"), c.projectColumnData},
'f': {i18n.G("FINGERPRINT"), c.fingerprintColumnData},
'F': {i18n.G("FINGERPRINT"), c.fingerprintFullColumnData},
'l': {i18n.G("ALIAS"), c.aliasColumnData},
'L': {i18n.G("ALIASES"), c.aliasesColumnData},
'p': {i18n.G("PUBLIC"), c.publicColumnData},
's': {i18n.G("SIZE"), c.sizeColumnData},
't': {i18n.G("TYPE"), c.typeColumnData},
'u': {i18n.G("UPLOAD DATE"), c.uploadDateColumnData},
}
columnList := strings.Split(c.flagColumns, ",")
columns := []imageColumn{}
for _, columnEntry := range columnList {
if columnEntry == "" {
return nil, fmt.Errorf(i18n.G("Empty column entry (redundant, leading or trailing command) in '%s'"), c.flagColumns)
}
for _, columnRune := range columnEntry {
column, ok := columnsShorthandMap[columnRune]
if ok {
columns = append(columns, column)
} else {
return nil, fmt.Errorf(i18n.G("Unknown column shorthand char '%c' in '%s'"), columnRune, columnEntry)
}
}
}
return columns, nil
}
Does someone know what “and optionally number of other aliases” mean and how it can be used? Is the functionality missing or am I just not figuring out how to use it?