mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 05:53:59 +00:00
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.
This commit is contained in:
parent
df0681d393
commit
0866013280
9 changed files with 15 additions and 13 deletions
|
@ -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)"
|
||||
|
|
|
@ -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)"
|
||||
|
|
|
@ -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)"
|
||||
|
|
|
@ -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 <file>"'
|
||||
|
||||
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)'
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue