about summary refs log tree commit diff
path: root/Completion/Unix/Command/_ln
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2014-10-21 20:53:51 +0200
committerOliver Kiddle <opk@zsh.org>2014-10-21 20:53:51 +0200
commit5e592fd9b0d0d5a0532ffa57667b3f5e7c09fa92 (patch)
tree2af5203a95aac5a327f8cd7fd9e9a4e1f207192a /Completion/Unix/Command/_ln
parentaf9f623273eb994d36d3f02ed37bac6edb10c7cb (diff)
downloadzsh-5e592fd9b0d0d5a0532ffa57667b3f5e7c09fa92.tar.gz
zsh-5e592fd9b0d0d5a0532ffa57667b3f5e7c09fa92.tar.xz
zsh-5e592fd9b0d0d5a0532ffa57667b3f5e7c09fa92.zip
33485: fixes for zstyle context handling
Diffstat (limited to 'Completion/Unix/Command/_ln')
-rw-r--r--Completion/Unix/Command/_ln25
1 files changed, 17 insertions, 8 deletions
diff --git a/Completion/Unix/Command/_ln b/Completion/Unix/Command/_ln
index 89b7177ab..12baf76a9 100644
--- a/Completion/Unix/Command/_ln
+++ b/Completion/Unix/Command/_ln
@@ -3,10 +3,17 @@
 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