Rework the setup-completion command to be more generally useful.

Review Request #13068 — Created May 25, 2023 and submitted

Information

RBTools
release-5.x

Reviewers

The setup-completion command has been around for a while, but it's
become less useful with time. It made an attempt to write completion
files to system directories for Linux or macOS, leaving Windows out, and
in fact leaving macOS out since system directories can't be written to.

Looking into what it would take to write these files safely to local
directories, it seems to be a mess, depending on bash/zsh versions,
distros, and configurations (e.g., Oh-My-ZSH vs. native ZSH setups).

Looking at some other completion-generator commands (npm, pip, and
pyenv), it seems that most don't bother trying to write and instead
leave it up to the user to place the code in the right place.

Given options, outputting the code is the best way to go, and has the
advantage of simplifying code considerably.

Documentation has been updated to walk users through configuring this.

Tested the auto-completion scripts with Bash and Zsh.

Tested default shell detection.

Tested using --json to get the script.

Built the docs. Read through them and checked for bad links, build
errors, and spelling errors.

Summary ID
Rework the setup-completion command to be more generally useful.
The `setup-completion` command has been around for a while, but it's become less useful with time. It made an attempt to write completion files to system directories for Linux or macOS, leaving Windows out, and in fact leaving macOS out since system directories can't be written to. Looking into what it would take to write these files safely to local directories, it seems to be a mess, depending on bash/zsh versions, distros, and configurations (e.g., Oh-My-ZSH vs. native ZSH setups). Looking at some other completion-generator commands (npm, pip, and pyenv), it seems that most don't bother trying to write and instead leave it up to the user to place the code in the right place. Given options, outputting the code is the best way to go, and has the advantage of simplifying code considerably. Documentation has been updated to walk users through configuring this.
3f65f0718de4eaedb3f89ed37913e18e42f7f7e0
Description From Last Updated

'rbtools.utils.appdirs.user_data_dir' imported but unused Column: 1 Error code: F401

reviewbotreviewbot

'rbtools.utils.filesystem.get_home_path' imported but unused Column: 1 Error code: F401

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-5.x (ed11f56)