From 0866013280d38b9e361dd5183114eb90db86115d Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Sat, 28 Dec 2019 17:00:48 +0100 Subject: [PATCH] Stop using __fish_complete_suffix with a braced argument __fish_complete_suffix accepts a first argument containing a brace-expansion, like __fish_complete_suffix '.{c,cpp,py}' We're gonna be removing the `eval` that does that shortly, so let's remove all uses in our code. --- share/completions/clang++.fish | 2 +- share/completions/clang.fish | 5 +++-- share/completions/hjson.fish | 2 +- share/completions/optipng.fish | 3 ++- share/completions/pacaur.fish | 2 +- share/completions/pacman.fish | 2 +- share/completions/phpunit.fish | 2 +- share/completions/ttx.fish | 8 ++++---- share/completions/yaourt.fish | 2 +- 9 files changed, 15 insertions(+), 13 deletions(-) diff --git a/share/completions/clang++.fish b/share/completions/clang++.fish index 783ddf7a1..904d56ea8 100644 --- a/share/completions/clang++.fish +++ b/share/completions/clang++.fish @@ -4,4 +4,4 @@ complete -p '*clang++*' -n '__fish_should_complete_switches' -xa '(__fish_clang_complete)' complete -p '*clang++*' -n 'not __fish_should_complete_switches' \ - -xa '(__fish_complete_suffix \'{.o,.out,.c,.cpp,.so,.dylib}\')' + -xa "(__fish_complete_suffix .o; __fish_complete_suffix .out; __fish_complete_suffix .c; __fish_complete_suffix .cpp; __fish_complete_suffix .so; __fish_complete_suffix .dylib)" diff --git a/share/completions/clang.fish b/share/completions/clang.fish index 020454f3a..3eec3575d 100644 --- a/share/completions/clang.fish +++ b/share/completions/clang.fish @@ -5,7 +5,8 @@ # This pattern unfortunately matches clang-format, etc. as well. complete -p '*clang*' -n '__fish_should_complete_switches' -xa '(__fish_clang_complete)' complete -c 'clang' -n 'not __fish_should_complete_switches' \ - -xa "(__fish_complete_suffix '{.o,.out,.c,.cpp,.so,.dylib}')" + -xa "(__fish_complete_suffix .o; __fish_complete_suffix .out; __fish_complete_suffix .c; __fish_complete_suffix .cpp; __fish_complete_suffix .so; __fish_complete_suffix .dylib)" + # again but without the -x this time for the pattern-matched completion complete -p '*clang*' -n 'not __fish_should_complete_switches' \ - -a "(__fish_complete_suffix '{.o,.out,.c,.cpp,.so,.dylib}')" + -a "(__fish_complete_suffix .o; __fish_complete_suffix .out; __fish_complete_suffix .c; __fish_complete_suffix .cpp; __fish_complete_suffix .so; __fish_complete_suffix .dylib)" diff --git a/share/completions/hjson.fish b/share/completions/hjson.fish index 8cd433fb7..8ed109ae2 100644 --- a/share/completions/hjson.fish +++ b/share/completions/hjson.fish @@ -11,4 +11,4 @@ complete -c hjson -n '__fish_should_complete_switches' -a "-rt" -d "round trip c complete -c hjson -n '__fish_should_complete_switches' -a "-nocol" -d "disable color output" complete -c hjson -n '__fish_should_complete_switches' -a "-cond=" -d "set condense option [default 60]" -complete -c hjson -k -xa "(__fish_complete_suffix '.{hjson,json}')" +complete -c hjson -k -xa "(__fish_complete_suffix .hjson; __fish_complete_suffix .json)" diff --git a/share/completions/optipng.fish b/share/completions/optipng.fish index 406d6117a..027fdecf0 100644 --- a/share/completions/optipng.fish +++ b/share/completions/optipng.fish @@ -37,5 +37,6 @@ complete -x -c optipng -n '__fish_should_complete_switches' -a '-dir\t"write out complete -x -c optipng -n '__fish_should_complete_switches' -a '-log\t"log messages to "' complete -x -c optipng -n 'not __fish_prev_arg_in -out -dir -log' \ - -a '(__fish_complete_suffix ".{png,PNG,pnm,PNM,tiff,TIFF,bmp,BMP}")' + -a '(__fish_complete_suffix .png; __fish_complete_suffix .pnm; __fish_complete_suffix .tiff; __fish_complete_suffix .bmp) + complete -x -c optipng -n '__fish_prev_arg_in -dir' -a '(__fish_complete_directories)' diff --git a/share/completions/pacaur.fish b/share/completions/pacaur.fish index 1b5870d8a..9e7166aff 100644 --- a/share/completions/pacaur.fish +++ b/share/completions/pacaur.fish @@ -163,4 +163,4 @@ complete -c $progname -n "$files" -l machinereadable -d 'Show in machine readabl # Theoretically, pacman reads packages in all formats that libarchive supports # In practice, it's going to be tar.xz or tar.gz # Using "pkg.tar.*" here would change __fish_complete_suffix's descriptions to "unknown" -complete -c $progname -n "$upgrade" -xa '(__fish_complete_suffix .pkg.tar\{,.xz,.gz\})' -d 'Package file' +complete -c $progname -n "$upgrade" -xa '(__fish_complete_suffix pkg.tar.xz; __fish_complete_suffix pkg.tar.gz)' -d 'Package file' diff --git a/share/completions/pacman.fish b/share/completions/pacman.fish index 188c1c344..a0d2264e3 100644 --- a/share/completions/pacman.fish +++ b/share/completions/pacman.fish @@ -142,4 +142,4 @@ complete -c $progname -n "$sync" -xa "$listall $listgroups" # Theoretically, pacman reads packages in all formats that libarchive supports # In practice, it's going to be tar.xz, tar.gz or tar.zst # Using "pkg.tar.*" here would change __fish_complete_suffix's descriptions to "unknown" -complete -c $progname -n "$upgrade" -d 'Package file' -xa "(__fish_complete_suffix .pkg.tar\{,.xz,.gz,.zst\})" +complete -c $progname -n "$upgrade" -xa '(__fish_complete_suffix pkg.tar.zst; __fish_complete_suffix pkg.tar.xz; __fish_complete_suffix pkg.tar.gz)' -d 'Package file' diff --git a/share/completions/phpunit.fish b/share/completions/phpunit.fish index 70db34109..1fb82a632 100644 --- a/share/completions/phpunit.fish +++ b/share/completions/phpunit.fish @@ -95,7 +95,7 @@ complete -f -c phpunit -l do-not-cache-result -d 'Do not write test results to c # Configuration Options: complete -x -c phpunit -l prepend -d 'A PHP script that is included as early as possible' complete -x -c phpunit -l bootstrap -d 'A PHP script that is included before the tests run' -complete -x -c phpunit -s c -l configuration -a '(__fish_complete_suffix ".xml{,.dist}")' -d 'Read configuration from XML file' +complete -x -c phpunit -s c -l configuration -a '(__fish_complete_suffix .xml; __fish_complete_suffix .xml.dist)' -d 'Read configuration from XML file' complete -f -c phpunit -l no-configuration -d 'Ignore default configuration file (phpunit.xml)' complete -f -c phpunit -l no-logging -d 'Ignore logging configuration' complete -f -c phpunit -l no-extensions -d 'Do not load PHPUnit extensions' diff --git a/share/completions/ttx.fish b/share/completions/ttx.fish index 8fc70c017..959c51e70 100644 --- a/share/completions/ttx.fish +++ b/share/completions/ttx.fish @@ -8,14 +8,14 @@ set -l formats raw row bitwise extfile set -l line_endings LF CR CRLF set -l woff_fmts woff woff2 -complete -f -c ttx -a '(__fish_complete_suffix .{otf,ttf,ttx,ttc})' -complete -c ttx -f -n '__fish_is_first_token' -a '(__fish_complete_suffix .{otf,ttf,ttx})' +complete -f -c ttx -a '(__fish_complete_suffix .otf; __fish_complete_suffix .ttf; __fish_complete_suffix .ttx; __fish_complete_suffix .ttc)' +complete -c ttx -f -n '__fish_is_first_token' -a '(__fish_complete_suffix .otf; __fish_complete_suffix .ttf; __fish_complete_suffix .ttx)' # General options complete -c ttx -f -s 'h' -d'Show help message' complete -c ttx -f -l 'version' -d'Show version info' complete -c ttx -x -s 'd' -d'Set output folder' -a '(__fish_complete_directories)' -complete -c ttx -r -s 'o' -d'Set output filename' -a '(__fish_complete_suffix .{otf,ttf,ttx})' +complete -c ttx -r -s 'o' -d'Set output filename' -a '(__fish_complete_suffix .otf; __fish_complete_suffix .ttf; __fish_complete_suffix .ttx)' complete -c ttx -f -s 'f' -d'Force output overwrite' complete -c ttx -f -s 'v' -d'Verbose output' complete -c ttx -f -s 'q' -d'Quiet mode' @@ -35,7 +35,7 @@ complete -c ttx -x -l 'unicodedata' -d'Custom database for character names [Unic complete -c ttx -x -l 'newline' -d'Set EOL format' -a "$line_endings" # Compile options -complete -c ttx -x -s 'm' -d'Merge named TTF/OTF with SINGLE .ttx input' -a '(__fish_complete_suffix .{otf,ttf})' +complete -c ttx -x -s 'm' -d'Merge named TTF/OTF with SINGLE .ttx input' -a '(__fish_complete_suffix .otf; __fish_complete_suffix .ttf)' complete -c ttx -f -s 'b' -d'Don\'t recalculate glyph bounding boxes' complete -c ttx -f -l 'recalc-timestamp' -d'Set font modified timestamp to current time' complete -c ttx -x -l 'flavor' -d'Set WOFF flavor' -a "$woff_fmts" diff --git a/share/completions/yaourt.fish b/share/completions/yaourt.fish index b76de0e99..a99ea01a0 100644 --- a/share/completions/yaourt.fish +++ b/share/completions/yaourt.fish @@ -174,7 +174,7 @@ complete -c $progname -n "$files" -l machinereadable -d 'Show in machine readabl # Theoretically, pacman reads packages in all formats that libarchive supports # In practice, it's going to be tar, tar.xz or tar.gz # Using "pkg.tar*" here would change __fish_complete_suffix's descriptions to "unknown" -complete -c $progname -n "$upgrade" -xa '(__fish_complete_suffix pkg.tar\{,.xz,.gz\})' -d 'Package file' +complete -c $progname -n "$upgrade" -xa '(__fish_complete_suffix pkg.tar.xz; __fish_complete_suffix pkg.tar.gz)' -d 'Package file' ## Yaourt only stuff # Clean options