From cb9f4e621fcaf83ba292292a9815d216715f2934 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Thu, 20 Apr 2017 14:00:30 +0200 Subject: [PATCH] lua completions: Try harder to find libraries Fedora puts them in /usr/lib64 without having /usr/lib as a symlink. Also silence errors (in case a directory doesn't exist) and stringify. See https://bugzilla.redhat.com/show_bug.cgi?id=1442628. CC @amluto. --- share/completions/lua.fish | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/completions/lua.fish b/share/completions/lua.fish index 21c8d1e00..1bfc1257d 100644 --- a/share/completions/lua.fish +++ b/share/completions/lua.fish @@ -1,6 +1,7 @@ complete -c lua -s e -d 'Execute string' -x -complete -c lua -s l -d 'Require library' -xa "( find /usr/lib/lua/ -name \*.so -printf '%f\n' | sed 's/.so//' )" +# Try the most common lib directories, silencing errors in case they don't exist. +complete -c lua -s l -d 'Require library' -xa "(find /usr/lib{,32,64}/lua/ -name \*.so -printf '%f\n' ^/dev/null | string replace -r '.so\$' '')" complete -c lua -s i -d 'Enter interactive mode after executing script' complete -c lua -s v -d 'Show version' complete -c lua -s h -l help -d 'Print help and exit'