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")
41 printf >&2 'aur version %s\n' "$aur_version"
44 printenv |
grep -E '^AUR' |
sort >&2
47 printf '%s\n' "$lib_dir"
51 if [[ "$PATH" != "$lib_dir:"* ]]; then
52 readonly PATH
=$lib_dir:$PATH
55 if type -P "aur-$1" >/dev
/null
; then
56 exec "aur-$1" "${@:2}"
58 printf >&2 '%s: %q is not an aur command\n' "$argv0" "$1"