I have a container that the shell therein runs bash. It has bash completion installed and it works fine. This container has many custom cli commands but they all must be prefaced with nextcloud. So if I type nex <tab> nex is unique enough to complete.
Is there a way to set a "default" completion when on a new cli line (blank) so that the first tab injects that default or I'd be ok just to inject nextcloud without a tab.
I searched around "bash completion" and the bash manpage as well as the help for complete. I've goofed around a bit with -D, -E and based on the verbiage it seems possible but I don't see how. Little help?
https://opensource.com/article/18/3/creating-bash-completion-script
https://linux.die.net/man/1/bash (search page for Completing)
complete: complete [-abcdefgjksuv] [-pr] [-DEI] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [name ...]
Specify how arguments are to be completed by Readline.
For each NAME, specify how arguments are to be completed. If no options
are supplied, existing completion specifications are printed in a way that
allows them to be reused as input.
Options:
-p print existing completion specifications in a reusable format
-r remove a completion specification for each NAME, or, if no
NAMEs are supplied, all completion specifications
-D apply the completions and actions as the default for commands
without any specific completion defined
-E apply the completions and actions to "empty" commands --
completion attempted on a blank line
-I apply the completions and actions to the initial (usually the
command) word
When completion is attempted, the actions are applied in the order the
uppercase-letter options are listed above. If multiple options are supplied,
the -D option takes precedence over -E, and both take precedence over -I.
Exit Status:
Returns success unless an invalid option is supplied or an error occurs.