about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Command/_mkdir14
1 files changed, 5 insertions, 9 deletions
diff --git a/Completion/Unix/Command/_mkdir b/Completion/Unix/Command/_mkdir
index f2299f7c7..afa9cc1f8 100644
--- a/Completion/Unix/Command/_mkdir
+++ b/Completion/Unix/Command/_mkdir
@@ -9,14 +9,6 @@ args=(
   '(-)*: :->directories'
 )
 
-case "$OSTYPE" in
-  linux*)
-    args+=(
-      '(-Z --context)'{-Z,--context=}'[set SELinux context]:SELinux context'
-    )
-  ;;
-esac
-
 _pick_variant -r variant gnu=gnu zsh='\(eval\)' $OSTYPE --help
 # It can still happen that there is a precommand command or builtin in the line.
 # In such cases, the variant has to be modified suitably, after further checking
@@ -41,13 +33,17 @@ case $variant in
     )
   ;|
   gnu)
+    if [[ $OSTYPE == linux* ]]; then
+      args+=(
+        '(-Z --context)'{-Z,--context=}'[set SELinux context]:SELinux context'
+      )
+    fi
     args+=(
       '(- :)--help[display help information]'
       '(- :)--version[display version information]'
     )
   ;;
   zsh) # remove all options
-    args=( '*: :->directories' )
   ;;
   *) # non-GNU: remove long options
     args=( ${${${args:#(|*\))--*}//--[^ )]#/}/\( #\)/} )