pi-top-Python-SDK
pi-top-Python-SDK copied to clipboard
Add bash autocomplete to CLI
See how pdm does this: https://pdm.fming.dev/#shell-completion We can combine this with some way to automatically add these lines to the OS.
shtab seems useful.
This should be installed via setup.py, not via Debian package (unless this doesn't copy over to Debian package)
- [ ] Add bash completion to
extras/pitop.bash-completion - [ ] Add to setup.py:
diff --git a/setup.py b/setup.py
index eb33d32..d8da7ac 100644
--- a/setup.py
+++ b/
@@ -191,6 +191,9 @@ def main():
setup_requires=['pytest-runner', 'flake8'],
tests_require=['pytest'],
entry_points=__entry_points__,
+ data_files=[
+ ('/usr/share/bash-completion/completions', ['extras/pitop.bash-completion']),
+ ],
)
- [ ] Review adding zsh completion
- [ ] Workflow: run
shtabto test if completions are up-to-date
Include bash-completion in Build-Depends.
Use dh $@ --with bash-completion in debian/rules.
Use configuration file at debian/package.bash-completion.
https://www.debian.org/doc/manuals/maint-guide/dreq.en.html#rules