Ok, let’s me trying to explain my script.
First of all, in the “Programmable Completion” (https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion.html#Programmable-Completion) we can see:
“First, the command name is identified. If a compspec has been defined for that command,
the compspec is used to generate the list of possible completions for the word.
If the command word is the empty string (completion attempted at the beginning of
an empty line), any compspec defined with the -E option to complete is used.
If the command word is a full pathname, a compspec for the full pathname is searched
for first. If no compspec is found for the full pathname, an attempt is made to find
a compspec for the portion following the final slash. If those searches do not result
in a compspec, any compspec defined with the -D option to complete is used as the default.”
That is, the difference between “./xbps-src” and “xbps-src” is the first one processing first in the “complete” command.
Second, in my variant you can install xbps-src script into your $PATH and work with different sets of etc/ and common/ dirs. I don’t like to work with “git branch” style in that case (in the future i want to patch xbps-src for unbind from current dir).
Of course, i don’t force you for using my variant, but my one is more general.