diff options
| author | pml68 <contact@pml68.dev> | 2025-09-07 12:03:10 +0200 |
|---|---|---|
| committer | pml68 <contact@pml68.dev> | 2025-09-07 12:03:10 +0200 |
| commit | c70c80c789df88aa4ed079c7f8b6fcd4a23cb095 (patch) | |
| tree | c3bc5cba5b744c0af99d331e7f3d5185cd501b39 /shell-completions/aur-completion.bash | |
| parent | feat: add Makefile (diff) | |
| download | aur-c70c80c789df88aa4ed079c7f8b6fcd4a23cb095.tar.gz | |
feat: add -r/--remove flags
Diffstat (limited to 'shell-completions/aur-completion.bash')
| -rw-r--r-- | shell-completions/aur-completion.bash | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/shell-completions/aur-completion.bash b/shell-completions/aur-completion.bash index 224f1ee..c365c2e 100644 --- a/shell-completions/aur-completion.bash +++ b/shell-completions/aur-completion.bash @@ -12,7 +12,7 @@ # shellcheck disable=2207 # editorconfig-checker-disable -_aur_comp_cmd_opts=( -h --help -v --version -l --list -f --force -g --git -c --config ) +_aur_comp_cmd_opts=( -h --help -v --version -l --list -f --force -g --git -c --config -r --remove ) _aur_comp_reply_aur_pkgs () @@ -59,6 +59,12 @@ _aur_comp_reply_list () eval "COMPREPLY=( \$(compgen -W \"$array_list\" -- \"\$cur\") )" } +_aur_comp_reply_pacman () +{ + pkgs=$(pacman -Qqm | paste -d ' ' -s -); + COMPREPLY=($(compgen -W "$pkgs" -- "$cur")) +} + _aur_comp_reply_words () { local IFS=$'\n'; @@ -95,6 +101,8 @@ _aur_completions() { # rely the value of command option -c) _aur_comp_reply_files ;; --config) _aur_comp_reply_files ;; + -r) _aur_comp_reply_pacman ;; + --remove) _aur_comp_reply_pacman ;; *) _aur_comp_reply_aur_pkgs ;; esac else |
