diff options
Diffstat (limited to '')
| -rwxr-xr-x | aur | 4 | ||||
| -rw-r--r-- | aur-completion.bash | 8 | ||||
| -rw-r--r-- | aur.completor.bash | 8 |
3 files changed, 8 insertions, 12 deletions
@@ -51,6 +51,10 @@ if [[ -n $1 ]]; then _update -g elif [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then _help 0 + elif [[ $1 == -* ]]; then + echo "Unknown option: $1" + echo "" + _help 16 else _update_or_install "$@" fi diff --git a/aur-completion.bash b/aur-completion.bash index f8938f9..554e106 100644 --- a/aur-completion.bash +++ b/aur-completion.bash @@ -17,12 +17,8 @@ _aur_comp_cmd_opts=( -h --help -l --list -f --force -g --git -c --config ) _aur_comp_reply_aur_pkgs () { - pkgs=($(find ~/.aur/ -type d -mindepth 1 -maxdepth 1)); - for i in "${!pkgs[@]}"; - do - pkgs[$i]=$(basename "${pkgs[$i]}"); - done; - COMPREPLY=($(compgen -W "${pkgs[*]}" -- "$cur")) + pkgs=`basename -a ~/.aur/*/ | paste -d ' ' -s -`; + COMPREPLY=($(compgen -W "$pkgs" -- "$cur")) } _aur_comp_reply_dirs () diff --git a/aur.completor.bash b/aur.completor.bash index 28117f4..c7513ed 100644 --- a/aur.completor.bash +++ b/aur.completor.bash @@ -11,11 +11,7 @@ cmd_opts=( ) reply_aur_pkgs() { - pkgs=( $(find ~/.aur/ -type d -mindepth 1 -maxdepth 1) ); - for i in "${!pkgs[@]}"; - do - pkgs[$i]=$(basename "${pkgs[$i]}"); - done; + pkgs=`basename -a ~/.aur/*/ | paste -d ' ' -s -` - COMPREPLY=( $(compgen -W "${pkgs[*]}" -- "$cur") ) + COMPREPLY=( $(compgen -W "$pkgs" -- "$cur") ) } |
