That is, user can eval $(texdoc --print-completion XXsh) in their bashrc/zshrc then
$ texdoc -<TAB>
option
-c Set configuration item NAME to VALUE.
-D Activate all debug output (equal to "--debug=all").
--debug Activate all debug output (equal to "--debug=all").
-d LIST, --debug=LIST
--files Print the list of configuration files used.
...
TIA!