CLI possible completions not listing all possible commands

Hi,

I got two questions on ConfD possible completions:

  1. Is there any difference between tab- and ?-completion?
  2. When I’m on a specific node (not at top level) and tab, the CLI does not list all the possiblities. e.g., if I’m on a list item which contains another list, the tab-/?-completion only gives a few (ommiting those that are not built-in commands): commit, describe, exit, help, no, pwd, top. And the number of listed items is far below the defined completionShowMax. There are more commands such as insert, move, rename, abort, etc., that are supposed to be available via auto completion (and these are indeed executable on the node). So why? Is there any ConfD config that affects this behavior?

Thanks!

  1. No, they are the same, except that tab-completion also completes (or partially completes) your command if there is only one option.

  2. Have a look at the confd.conf option /confdConfig/cli/topLevelCmdsInSubMode - sounds like this is what you are looking for.

1 Like

Appreciated! That answered all! :smile:

Hi @mvf,
For the 2nd question, it seems better from user’s view if topLevelCmdsInSubMode is true as default. Because in submode all the commands and their help text are listed. It is more friendly to users.
Would you please explain why the better behavior is not the default one? Any potential negative consequences that is not immediately obvious if topLevelCmdsInSubMode is true as default?
Thank you very much.
BRs

I am not able to answer questions regarding authors’ intentions. My view is that in a CLI-driven system, certain commands should be deemed global and available everywhere, other top-level commands should better be used only from the top level. I don’t think there really is a large potential of negative consequences; I can only think of possible name clashes when a subnode is given a name that is already used for a built-in command.

If you feel that using topLevelCmdsInSubMode makes your system more user-friendly, go ahead and use it, I’m sure that’s exactly why the option exists.

1 Like