]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/blobdiff - contrib/bash_completion/autorandr
Add new options to completion files
[deb_pkgs/autorandr.git] / contrib / bash_completion / autorandr
index e7f098c1b4474db3596c2e659fbf74e80b469feb..904ef8035e557e34a20b381d6a3ccbe9872b1418 100644 (file)
@@ -10,7 +10,7 @@ _autorandr ()
        prev="${COMP_WORDS[COMP_CWORD-1]}"
 
        opts="-h -c -s -r -l -d"
-       lopts="--help --change --save --remove --load --default --force --fingerprint --config --dry-run"
+       lopts="--help --change --cycle --save --remove --load --list --default --force --fingerprint --config --dry-run"
 
        # find system-level autorandr dirs
        OIFS="$IFS"
@@ -29,9 +29,9 @@ _autorandr ()
                AR_DIRS=( "${AR_DIRS[@]}" "${XDG_CONFIG_HOME:-$HOME/.config}/autorandr/" )
        fi
 
-       if [ -n "${AR_DIRS}" ]
+       if [ "${#AR_DIRS[@]}" -gt 0 ]
        then
-               prfls="$(find "${AR_DIRS[@]}" -mindepth 1 -maxdepth 1 -type d ! -name "*.d" -printf '%f\n' | sort -u)"
+               prfls="$(find "${AR_DIRS[@]}" -mindepth 1 -maxdepth 1 -type d ! -name "*.d" -printf '%f\n' 2>/dev/null | sort -u)"
        else
                prfls=""
        fi