2 readonly XDG_CONFIG_HOME
=${XDG_CONFIG_HOME:-$HOME/.config}
4 readonly aur_version
='AURUTILS_VERSION'
5 readonly lib_dir
=${AUR_EXEC_PATH:-'AURUTILS_LIB_DIR'}
9 printf >&2 'usage: %s [command]\n\n' "$argv0"
10 printf >&2 'available commands:\n'
12 for p
in "$lib_dir"/aur-
*; do
13 printf '%q\n' "${p##*/aur-}"
16 printf >&2 '\navailable user commands:\n'
18 compgen
-c aur- |
sort -u |
while IFS
= read -r; do
19 if ! [[ -x $lib_dir/$REPLY ]]; then
20 printf '%q\n' "${REPLY#aur-}"
28 if [[ -f ${AUR_ENV=$XDG_CONFIG_HOME/aurutils/env} ]]; then
29 while IFS
=' = ' read -r key value
; do
31 AUR
*) printf -v "$key" '%s' "$value"
34 done < <(pacini
"$AUR_ENV")
39 if [[ -v AUR_DEBUG
]]; then
40 printf >&2 'aur version %s\n' "$aur_version"
45 printf >&2 'aur version %s\n' "$aur_version"
48 printenv |
grep -E '(^AUR|PERL5LIB)' |
sort >&2
51 printf '%s\n' "$lib_dir"
55 if [[ "$PATH" != "$lib_dir:"* ]]; then
56 readonly PATH
=$lib_dir:$PATH
59 if type -P "aur-$1" >/dev
/null
; then
60 exec "aur-$1" "${@:2}"
62 printf >&2 '%s: %q is not an aur command\n' "$argv0" "$1"