fix(comp): Prepare plugin completion for Cobra 1.0
fix(comp): Prepare plugin completion for Cobra 1.0

Cobra 1.0.0 introduces support for Custom Go Completions.  However,
there is a small difference compared to helm's existing solution.
The difference is that Cobra will not complete sub-commands if there
are any dynamic completion functions registered.

The way helm implemented plugin completions had the dynamic completion
function associated with the root plugin command (e.g. 2to3); with
Cobra, this prevents any of the sub-commands of the plugin to be
completed (i.e., 2to3 <TAB> will not show the static sub-commands).

The solution is to only register the dynamic completion function for a
plugin command that doesn't have any further sub-commands.  This allows
all sub-commands to be completed properly, and when there are no more
levels of sub-commands, the dynamic completion is called.

This commit had to make two changes to achieve this:
1- refactor the load_plugins.go file to extract the logic to call
   the plugin.complete executable (for dynamic completions), so that
   it could be added to each final sub-command.
2- load the static completion not only for the "completion" command like
   before, but also for the "__complete" command, so that when the
   __complete command is called for dynamic completion of a sub-command,
   it is aware of the sub-command in question.

The second change is also valuable for the future support of completion
for the Fish shell.  Completion for the fish shell uses the __complete
command not only for dynamic completions but also for basic command and
flag completion. This implies that the __complete command must be aware
of the plugins sub-commands, and therefore that the plugin's static
completion be loaded.

Signed-off-by: Marc Khouzam <f4a9dd7a4da9e90228a1f1935992f35508714eb1@montreal.ca>

michelleN/deployment-manager,helm/helm,adamreese/helm,adamreese/helm,bacongobbler/helm,helm/helm,michelleN/deployment-manager,michelleN/deployment-manager,bacongobbler/helm,michelleN/deployment-manager