Incus image list number of displayed aliases

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?

The (and optionally number of other aliases) means that it will show in the table how many other aliases exist. Obviously, the table is not suitable to show multiple aliases but rather it gives you a number.

That is, there is no way to use l with a number to show the list of aliases, when you are presented with the table.

Ooh…

Is the wording dubious in that case? It’s not optional, it always has that behavior.

BTW, uppercase L shows all of them separate in new lines, so the table is suitable to show multiple aliases.

And also, just to avoid being misunderstood, I’m not suggesting this is a desired feature, just trying to understand the help message.

  Column shorthand chars:

      l - Shortest image alias (and optionally number of other aliases)

My understanding is that an image may or may not have more than one aliases.
In that sense, -l shows the shortest image alias (shortest, if there are more than one), and if there are more than one aliases, it shows how many more aliases are there.

Perhaps the wording should change to the following?

  Column shorthand chars:

      l - Shortest image alias (and number of other aliases, if there are more than one)

It looks too long. If it was me, I would just remove the word “optionally”.