pi-top / pi-top-Python-SDK

pi-top's Python SDK (pitop package)
Apache License 2.0
28 stars 4 forks source link

Add bash autocomplete to CLI #93

Open m-roberts opened 3 years ago

m-roberts commented 3 years ago

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)

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']),
+            ],
         )
m-roberts commented 3 years ago

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