fish-shell/share/completions/sed.fish
axel 343cafef34 Redo installation file structure, move lots of things to $PREFIX/share/fish
darcs-hash:20060217101339-ac50b-d93d2c620a4b7f75f05ff461a6edbee001da7613.gz
2006-02-17 20:13:39 +10:00

38 lines
1.3 KiB
Fish

#
# Completions for sed
#
# Test if we are using GNU sed
set -l is_gnu
sed --version >/dev/null ^/dev/null; and set is_gnu --is-gnu
# Shared ls switches
__fish_gnu_complete -c sed -s n -l quiet -d (_ "Silent mode") $is_gnu
__fish_gnu_complete -c sed -s e -l expression -x -d (_ "Evaluate expression") $is_gnu
__fish_gnu_complete -c sed -s f -l file -r -d (_ "Evalute file") $is_gnu
__fish_gnu_complete -c sed -s i -l in-place -d (_ "Edit files in place") $is_gnu
if test -n "$is_gnu"
# GNU specific features
complete -c sed -l silent -d (_ "Silent mode")
complete -c sed -s l -l line-length -x -d (_ "Specify line-length")
complete -c sed -l posix -d (_ "Disable all GNU extensions")
complete -c sed -s r -l regexp-extended -d (_ "Use extended regexp")
complete -c sed -s s -l separate -d (_ "Consider files as separate")
complete -c sed -s u -l unbuffered -d (_ "Use minimal IO buffers")
complete -c sed -l help -d (_ "Display help and exit")
complete -c sed -s V -l version -d (_ "Display version and exit")
else
# If not a GNU system, assume we have standard BSD ls features instead
complete -c sed -s E -d (_ "Use extended regexp")
complete -c sed -s a -d (_ "Delay opening files until a command containing the related 'w' function is applied")
complete -c sed -s l -d (_ "Use line buffering")
end