On 5/22/2025 12:24 AM, Stephen Hemminger wrote:
On Wed, 14 May 2025 14:02:12 +0100
Anatoly Burakov <anatoly.bura...@intel.com> wrote:

When using '?' to find commands, it occasionally is difficult to find the
needed commands because all commands are not in alphabetical order, but
rather can be ordered rather arbitrarily.

To address this, use help string to order commands. This sacrifices some
amount of grouping (i.e. when tm commands go one after another), but may
improve discoverability (and most similar commands tend to have similar
help strings and will be located closer together anyway).

Signed-off-by: Anatoly Burakov <anatoly.bura...@intel.com>
---

Sorting is good, but why not pre-sort builtin_ctx and make it const?


It's difficult and error-prone to sort these messages statically because there's no obvious to know where to insert the new value without reading lots of help strings from other commands. You could argue that we could sort by variable name but it feels like an unnecessary burden on the developer to maintain this sorting order when we can just automate it at runtime without giving up anything.

--
Thanks,
Anatoly

Reply via email to