updated on Tue Jan 10 16:09:17 UTC 2012
[aur-mirror.git] / apparix / apparix.sh
blob9bad62b82fca9a4c8fc24684d75b4a628aa08c65
3 function to()
5 if test "$2"; then
6 cd "$(apparix "$1" "$2" || echo .)";
7 else
8 cd "$(apparix "$1" || echo .)";
9 fi
10 pwd
13 function bm()
15 if test "$2"; then
16 apparix --add-mark "$1" "$2";
17 elif test "$1"; then
18 apparix --add-mark "$1";
19 else
20 apparix --add-mark;
24 function portal()
26 if test "$1"; then
27 apparix --add-portal "$1";
28 else
29 apparix --add-portal;
33 function _apparix_aliases ()
34 { cur=$2
35 dir=$3
36 COMPREPLY=()
37 if [ "$1" == "$3" ]
38 then
39 COMPREPLY=($(cat $HOME/.apparix{rc,expand}|grep "j,.*$cur.*,"|cut -f2 -d,))
40 else
41 dir=`apparix -favour lro $dir 2>/dev/null` || return 0
42 eval_compreply="
43 COMPREPLY=( $(cd "$dir" ; ls -d *$cur* |
44 while read r
46 [[ -d "$r" ]] && [[ $r == *$cur* ]] && echo \"${r// /\\ }\"
47 done))"
48 eval $eval_compreply
50 return 0
52 complete -F _apparix_aliases to