posixify!

This commit is contained in:
Wilke Schwiedop 2016-12-21 18:44:57 +01:00
parent 28cde83c33
commit fa7682ec3c
3 changed files with 4 additions and 3 deletions

View file

@ -53,13 +53,13 @@ function __fish_print_gpg_algo -d "Complete using all algorithms of the type spe
# define label 'loop'
# if the line ends with a ','
# add next line to buffer
# remove '\n' and following spaces
# transliterate '\n' with ' '
# goto loop
# remove everything until the first ':' of the line
# remove all blanks
# transliterate ',' with '\n' (OSX apparently doesn't like '\n' on RHS of the s-command)
# print result
gpg --version | sed -ne "/$argv:/"'{:loop; /,$/{N; s!\n[ ]*! !; b loop}; s!^[^:]*:!!; s![ ]*!!g; y!,!\n!; p}'
gpg --version | sed -ne "/$argv:/"'{:loop; /,$/{N; y!\n! !; b loop}; s!^[^:]*:!!; s![ ]*!!g; y!,!\n!; p}'
end

View file

@ -23,6 +23,7 @@ complete -c ssh -s a --description "Disables forwarding of the authentication ag
complete -c ssh -s A --description "Enables forwarding of the authentication agent"
complete -x -c ssh -s b --description "Interface to transmit from" -a "
(
# TODO /proc/net/arp is not POSIX compliant
cut -d ' ' -f 1 /proc/net/arp ^/dev/null | string match -r -v '^IP'
)
"

View file

@ -1,3 +1,3 @@
function __fish_print_xdg_mimetypes --description 'Print XDG mime types'
sed -e '/\[MIME Cache\]/d; y!=!\t!' ~/.local/share/applications/mimeinfo.cache /usr/share/applications/mimeinfo.cache
cat ~/.local/share/applications/mimeinfo.cache /usr/share/applications/mimeinfo.cache ^/dev/null | string match -v '[MIME Cache]' | string replace = \t
end