fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
a53db7256
master
1# localization: skip(private) 2function __fish_complete_list --argument-names div cmd prefix iprefix 3if not set -q cmd[ 1 ] 4echo "Usage: 5__fish_complete_list <separator> <function> <prefix> <itemprefix> 6where: 7separator - a symbol, separating individual entries 8function - a function which prints a completion list to complete each entry 9prefix - a prefix, which is printed before the list 10itemprefix - a prefix, which is printed before each item" > /dev/stderr 11return 1 12end 13set -q iprefix[ 1 ] 14or set -l iprefix"" 15set -q prefix[ 1 ] 16or set -l prefix"" 17set -l pat"$ ( commandline -t ) " 18if set -q __fish_stripprefix[ 1 ] 19set pat"$ ( string replace -r -- " $__fish_stripprefix " "" $pat ) " 20end 21switch $pat 22case "* $div *" 23for iin ( string unescape --$pat | sed "s/^\(.\+ $div \) $iprefix .*\$/\1/" ) $iprefix ( eval $cmd ) 24printf %s\n $i 25end 26case '*' 27for iin $prefix$iprefix ( eval $cmd ) 28printf %s\n $i 29end 30end 31 32end