summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_ln
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2015-05-05 23:32:59 +0200
committerAxel Beckert <abe@deuxchevaux.org>2015-05-05 23:58:59 +0200
commitdb38e167634b6c2217eec3a5aafc37c46d9e5a8d (patch)
treedaa342d423febbd3a5a7ef97053037677fab004a /Completion/Unix/Command/_ln
parent01eea47617a6e06debdb4330f92ae69f92089fd2 (diff)
parent3c3c8d3d13fd4cf6c03f81ca8dc18a1efd561728 (diff)
downloadzsh-db38e167634b6c2217eec3a5aafc37c46d9e5a8d.tar.gz
zsh-db38e167634b6c2217eec3a5aafc37c46d9e5a8d.zip
Merge branch 'upstream' into debian
Diffstat (limited to 'Completion/Unix/Command/_ln')
-rw-r--r--Completion/Unix/Command/_ln27
1 files changed, 18 insertions, 9 deletions
diff --git a/Completion/Unix/Command/_ln b/Completion/Unix/Command/_ln
index 89b7177ab..c903fee02 100644
--- a/Completion/Unix/Command/_ln
+++ b/Completion/Unix/Command/_ln
@@ -1,12 +1,19 @@
-#compdef ln gln
+#compdef ln gln zf_ln
local curcontext="$curcontext" state line ret=1
local -A opt_args
-local -a args
+local -a args bsd
args=(
'-f[remove existing destination files]'
- '-s[create symbolic links instead of hard links]')
+ '-s[create symbolic links instead of hard links]'
+)
+bsd=(
+ '-F[remove existing destination directories]'
+ {-h,-n}'[do not dereference destination]'
+ '-i[prompt before removing destination files]'
+ '-v[print name of each linked file]'
+)
local -a opts
@@ -44,14 +51,16 @@ elif (( ${+builtins[ln]} )); then
{-h,-n}'[do not dereference destination]'
'-i[prompt before removing destination files]')
elif [[ $OSTYPE == darwin* ]]; then
- args+=(
- '-F[remove existing destination directories]'
- {-h,-n}'[do not dereference destination]'
- '-i[prompt before removing destination files]'
- '-v[print name of each linked file]')
+ args+=( $bsd )
+elif [[ $OSTYPE == freebsd* ]]; then
+ args+=( $bsd
+ '(-L)-P[create hard links directly to symbolic links]'
+ '(-P)-L[create hard links to symbolic link references]'
+ "-w[warn if source of a symbolic link doesn't currently exist]"
+ )
fi
-_arguments -s $opts \
+_arguments -C -s $opts \
$args \
':link target:_files' \
'*:: :->files' && ret=0