feature request on ppa-name bash-completion
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ppa-purge (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I hope ppa-purge could introduce bash-completion for ppa names. I don't know others, but for me it's badly inconvenient. For many times have I input the wrong name, for many times have I googled to confirm the right name, and for many times have I input a correct name and wait for long only to find out the ppa has been disabled in the sources.list. Hence it would be necessary to introduce bash-completion to auto fill the name form.
Here is a basic bash-completion example for listing the 'meta' names located in /etc/apt/
-------
# /usr/share/
# Debian ppa-purge(1) completion -*- shell-script -*-
_ppa_purge(){
local cur
_init_
local list=( $( find /etc/apt/
local i=0
local wc=${#list[@]}
while [[ $i -lt $wc ]]
do
if ! grep -Ev ^# "/etc/apt/
unset list[$i]
fi
let i++
done
COMPREPLY=( $( compgen -W '${list[@]}' -- "$cur" ) )
return 0
} &&
complete -F _ppa_purge ppa-purge
-------
Note It cannot work directly since it has to include the arguments used as 'prefix', which however is quite straightforward to work around. And the reply message could be sourced from the .list file instead of the filename and further divided into ppa name and team name , which is quite straightforward too. It's also an option to designate a separate argument for ppa-purge to include this completion feature.
Related branches
- Robert Hooker: Pending requested
- ppa-purge: Pending requested
-
Diff: 196 lines (+108/-12)5 files modifieddebian/changelog (+5/-0)
debian/control (+1/-1)
debian/ppa-purge.bash-completion (+80/-0)
debian/rules (+1/-1)
ppa-purge (+21/-10)
Status changed to 'Confirmed' because the bug affects multiple users.