# Author: Elan Ruusamäe <glen@pld-linux.org>
# return list of pld ftp trees
-_pld_ftp_tree() {
+_pfa_tree() {
local cur="$1"
- if [ -z "$PLD_FTP_TREES" ]; then
+ if [ -z "$PFA_TREES" ]; then
local d
local -a trees
for d in ~/ftp/*/; do
d=${d%/}
d=${d##*/}
- PLD_FTP_TREES+=" $d"
+ PFA_TREES+=" $d"
done
# kill leading space
- PLD_FTP_TREES=${PLD_FTP_TREES# }
+ PFA_TREES=${PFA_TREES# }
fi
- COMPREPLY=( $( compgen -W "$PLD_FTP_TREES" -- "$cur" ) )
+ COMPREPLY=( $( compgen -W "$PFA_TREES" -- "$cur" ) )
}
# return list of files in a tree
-_pld_ftp_tree_files() {
+_pfa_tree_files() {
local tree="$1" cur="$2" file i
local dir=~/ftp/$tree/SRPMS/.metadata
done
}
-have gen-indexes &&
-_gen-indexes()
+have pfa-genindex &&
+_pfa-genindex()
{
local cur
' \
-- "$cur" ) )
else
- _pld_ftp_tree "$cur"
+ _pfa_tree "$cur"
fi
} &&
-complete -F _gen-indexes gen-indexes
+complete -F _pfa-genindex pfa-genindex
-have lintpkg &&
-_lintpkg()
+have pfa-lintpkg &&
+_pfa-lintpkg()
{
local cur
_count_args :
if [[ $args == 1 ]]; then
- _pld_ftp_tree "$cur"
+ _pfa_tree "$cur"
else
- _pld_ftp_tree_files "${COMP_WORDS[1]}" "$cur"
+ _pfa_tree_files "${COMP_WORDS[1]}" "$cur"
fi
} &&
-complete -F _lintpkg lintpkg signpkg rmpkg
+complete -F _pfa-lintpkg pfa-lintpkg pfa-signpkg pfa-rmpkg
-have mvpkg &&
-_mvpkg()
+have pfa-mvpkg &&
+_pfa-mvpkg()
{
local cur
_count_args :
if [[ $args == 1 ]] || [[ $args == 2 ]]; then
- _pld_ftp_tree "$cur"
+ _pfa_tree "$cur"
else
- _pld_ftp_tree_files "${COMP_WORDS[1]}" "$cur"
+ _pfa_tree_files "${COMP_WORDS[1]}" "$cur"
fi
} &&
-complete -F _mvpkg mvpkg testmvpkg
+complete -F _pfa-mvpkg pfa-mvpkg pfa-testmvpkg
# Local variables:
# mode: shell-script