If only gz-tools is installed without the other gz libraries, tab completion gives strange results because the output of ign help and ign --commands is
I cannot find any available 'ign' command:
* Did you install any ignition library?
* Did you set the IGN_CONFIG_PATH environment variable?
E.g.: export IGN_CONFIG_PATH=$HOME/local/share/ignition
and that's what's used to build up the list of candidates for tab completion. This PR checks if the ign help or ign --commands ran successfully, otherwise, sets the string to "" so that it does not participate in tab completion. As a result, only the help subcommand is listed as a candidate.
This PR also gets rid of a warning message:
bash: /usr/share/gz/gz*.completion.d/*.bash_completion.sh: No such file or directory
when manually sourcing the <prefix>/share/bash-completion/completions/ign script with no other gz libraries installed.
Checklist
[ ] Signed all commits for DCO
[ ] Added tests
[ ] Updated documentation (as needed)
[ ] Updated migration guide (as needed)
[ ] Consider updating Python bindings (if the library has them)
[ ] While waiting for a review on your PR, please help review another open pull request to support the maintainers
Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.
🦟 Bug fix
Summary
If only
gz-tools
is installed without the other gz libraries, tab completion gives strange results because the output ofign help
andign --commands
isand that's what's used to build up the list of candidates for tab completion. This PR checks if the
ign help
orign --commands
ran successfully, otherwise, sets the string to""
so that it does not participate in tab completion. As a result, only thehelp
subcommand is listed as a candidate.This PR also gets rid of a warning message:
when manually sourcing the
<prefix>/share/bash-completion/completions/ign
script with no other gz libraries installed.Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.