2005-09-20 13:31:55 +00:00
|
|
|
#Completions for rm
|
2018-04-01 20:42:38 +00:00
|
|
|
if rm --version >/dev/null 2>/dev/null # GNU
|
2019-03-09 23:02:25 +00:00
|
|
|
complete -c rm -s d -l directory -d "Unlink directories"
|
|
|
|
complete -c rm -s f -l force -d "Never prompt for removal"
|
|
|
|
complete -c rm -s i -l interactive -d "Prompt for removal"
|
|
|
|
complete -c rm -s I -d "Prompt to remove >3 files"
|
|
|
|
complete -c rm -s r -l recursive -d "Recursively remove subdirs"
|
|
|
|
complete -c rm -s R -d "Recursively remove subdirs"
|
2017-10-11 17:17:35 +00:00
|
|
|
complete -c rm -s v -l verbose -d "Explain what is done"
|
2019-03-09 23:02:25 +00:00
|
|
|
complete -c rm -s h -l help -d "Display help"
|
|
|
|
complete -c rm -l version -d "Display rm version"
|
2018-11-25 14:08:24 +00:00
|
|
|
else
|
|
|
|
set -l uname (uname -s)
|
|
|
|
# solaris: rm [-fi ] file ...
|
|
|
|
# openbsd: rm [-fidPRrv ] file ...
|
|
|
|
# macos: rm [-fidPRrvW ] file ...
|
|
|
|
# netbsd: rm [-fidPRrvWx ] file ...
|
|
|
|
# freebsd: rm [-fidPRrvWxI] file ...
|
|
|
|
# dragonfly: rm [-fidPRrvWxI] file ...
|
|
|
|
|
2019-03-09 23:02:25 +00:00
|
|
|
complete -c rm -s f -d "Never prompt for removal"
|
|
|
|
complete -c rm -s i -d "Prompt for removal"
|
2018-11-25 14:08:24 +00:00
|
|
|
test "$uname" = SunOS
|
|
|
|
and exit 0
|
2019-03-09 23:02:25 +00:00
|
|
|
complete -c rm -s d -d "Remove directories as well"
|
2015-11-27 10:28:41 +00:00
|
|
|
complete -c rm -s P -d "Overwrite before removal"
|
2019-03-09 23:02:25 +00:00
|
|
|
complete -c rm -s R -s r -d "Recursively remove subdirs"
|
2015-11-27 10:28:41 +00:00
|
|
|
complete -c rm -s v -d "Explain what is done"
|
2018-11-25 14:08:24 +00:00
|
|
|
test "$uname" = OpenBSD
|
|
|
|
and exit 0
|
2019-03-09 23:02:25 +00:00
|
|
|
complete -c rm -s W -d "Undelete given filenames"
|
2018-11-25 14:08:24 +00:00
|
|
|
test "$uname" = Darwin
|
|
|
|
and exit 0
|
2019-03-09 23:02:25 +00:00
|
|
|
complete -c rm -s x -d "Don't traverse mount points"
|
2018-11-25 14:08:24 +00:00
|
|
|
test "$uname" = NetBSD
|
|
|
|
and exit 0
|
2019-03-09 23:02:25 +00:00
|
|
|
complete -c rm -s I -d "Prompt to remove >=3 files"
|
2015-11-27 10:28:41 +00:00
|
|
|
end
|