From 9f5ce0422969d15c8045744becdccf45ab1313f5 Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Sat, 18 Feb 2017 19:54:36 -0800 Subject: [PATCH] fix perl completions Fixes #3856 --- share/completions/perl.fish | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/share/completions/perl.fish b/share/completions/perl.fish index 83203585a..18c7c4097 100644 --- a/share/completions/perl.fish +++ b/share/completions/perl.fish @@ -1,8 +1,15 @@ +# TODO: Remove the `begin;...;end` brackets since they're not necessary. A `set -l` at file level +# creates a var local to the file which won't be visible elsewhere. I'm not doing so as part of +# fixing issue #3856 because I don't want to take ownership of every line in this script. +# +# TODO: Whether the expensive operations +# done by the module detection really needs to be done every time the completion is invoked is +# unclear. See issue #3856. begin set -l unicode 'commandline | __fish_sgrep -qe "-[a-zA-Z]*C[a-zA-Z]*\$"' set -l noopt 'commandline | not __fish_sgrep -qe "-[a-zA-Z]*C[a-zA-Z]*\$"' set -l modules "(find (perl -lE'print for @INC') -name '*.pm' -printf '%P\n' ^/dev/null \ - | sed -e 's,/,::,g; s,\.pm$,,' | sort -u)" + | sed -e 's,/,::,g; s,\.pm\$,,' | sort -u)" complete -c perl -s 0 -n $noopt --description 'Specify record separator' complete -c perl -s a -n $noopt --description 'Turn on autosplit mode' complete -c perl -s c -n $noopt --description 'Check syntax'