How to preserve an enumeration's actual ordering in the CLI?

An enumeration in Yang has an implied ordering. When the ConfD CLI presents the enumerated items in response to “?”, it always reorders the items to be in alphabetic order.

For example, if we have a Yang element “foo” that is an enumeration “high”, “medium”, “low”, then when a user types the CLI command “foo ?” to see the possible values, the command shows them in this order:

high
low
medium

However, the desired ordering is:

high
medium
low

Is there a way to force the CLI to honor the ordering implied in the enumeration when displaying the choices to the user?

Unfortunately no.

There’s no way to control the ordering of enums in the yang-model or in cli-spec files. Even custom completion callback will only sort lexicographically.