linuxmint / mintsystem

https://www.linuxmint.com
53 stars 34 forks source link

apt: fix bash completion handling of -- arguments #106

Closed mostthingsweb closed 4 years ago

mostthingsweb commented 5 years ago

Previously, if you typed "apt --f" and press tab, you'll get some errors like:

apt --fbash: compgen: --: invalid option compgen: usage: compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word] bash: compgen: --: invalid option

This is because of a missing "--" separator in the call to compgen, as well as inappropriate usage of backslashes.

This also adds completion for the --help flag, i.e.;

apt --h[TAB] completes as: apt --help