ZX: list versions

zx list versions PackageID

List available versions, possibly limited by a partial version identifier in the provided PackageID argument. If the realm segment of PackageID is omitted then the default realm, "otpr", is assumed. Similar to "latest", this command expects a partial or omitted version segment, but it will return a single result if the PackageID exactly matches a complete existing package version.

In the example below all versions of a package are queried:

ceverett@takoyaki:~$ zx list versions example_realm-hello_world
0.1.0
1.0.0
1.1.0
1.1.1
2.0.0
ceverett@takoyaki:~$ 

In the next example the list of versions is constrained by a partial version identifier:

ceverett@takoyaki:~$ zx list versions example_realm-hello_world-1.1
1.1.0
1.1.1
ceverett@takoyaki:~$ 

In the next example we have omitted the realm segment of PackageID so the default realm "otpr" is assumed, causing a different set of versions to be displayed.

ceverett@takoyaki:~$ zx list versions hello_world
0.1.0
0.1.1
1.0.0
1.0.1
1.1.0
1.1.1
ceverett@takoyaki:~$ 

This command returns nothing in the case a version match is not found and sets the exit status to 1:

ceverett@takoyaki:~$ zx list versions example_realm-hello_world-5
ceverett@takoyaki:~$ echo $?
1
ceverett@takoyaki:~$