about summary refs log tree commit diff
path: root/Completion/Unix/Command/_ls
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2016-07-08 23:09:18 +0200
committerOliver Kiddle <opk@zsh.org>2016-07-08 23:10:41 +0200
commit304aa25184f927ccc034bb98f6ac744d29006bb4 (patch)
treedf1810ccaf5e223913493bce2e2e3528a3667820 /Completion/Unix/Command/_ls
parent13f4bb29363e2a4c6a6e2971a929bd677043d866 (diff)
downloadzsh-304aa25184f927ccc034bb98f6ac744d29006bb4.tar.gz
zsh-304aa25184f927ccc034bb98f6ac744d29006bb4.tar.xz
zsh-304aa25184f927ccc034bb98f6ac744d29006bb4.zip
38812: a few new completions and update some command options
Diffstat (limited to 'Completion/Unix/Command/_ls')
-rw-r--r--Completion/Unix/Command/_ls15
1 files changed, 11 insertions, 4 deletions
diff --git a/Completion/Unix/Command/_ls b/Completion/Unix/Command/_ls
index f2e149453..74f317ad1 100644
--- a/Completion/Unix/Command/_ls
+++ b/Completion/Unix/Command/_ls
@@ -1,6 +1,6 @@
 #compdef ls gls
 
-local arguments is_gnu
+local arguments is_gnu datef
 
 if ! _pick_variant gnu=gnu unix --help; then
   arguments=(
@@ -70,6 +70,7 @@ if ! _pick_variant gnu=gnu unix --help; then
     )
   fi
 else
+  [[ $PREFIX = *+* ]] && datef='formats:format: _date_formats'
   arguments=(
     '(--all -a -A --almost-all)'{--all,-a}'[list entries starting with .]'
     '(--almost-all -A -a --all)'{--almost-all,-A}'[list all except . and ..]'
@@ -89,6 +90,7 @@ else
 
     '(--format -l -g -o -1 -C -m -x)-l[long listing]'
     '(--format -l -1 -C -m -x)-g[long listing but without owner information]'
+    --group-directories-first
     '(--format -l --no-group -G -1 -C -m -x)-o[no group, long]'
     '(--format -l -g -o -C -m -x)-1[single column output]'
     '(--format -l -g -o -1 -m -x)-C[list entries in columns sorted vertically]'
@@ -101,7 +103,7 @@ else
     '(--time -u)-c[status change time]'
     '(--time -c)-u[access time]'
     '(-c -u)--time=[specify time to show]:time:(ctime status use atime access)'
-    '--time-style=[show times using specified style]:time style:(full-iso long-iso iso locale)'
+    '--time-style=[show times using specified style]:style: _alternative "time-styles\:time style\:(full-iso long-iso iso locale)" $datef'
 
     '(-a --all -U -l --format -s --size -t --sort --full-time)-f[unsorted, all, short list]'
     '(--reverse)'{--reverse,-r}'[reverse sort order]'
@@ -114,10 +116,10 @@ else
     '(-S -t -U -v -X)--sort=:sort:(size time none version extension)'
 
     '--color=-[control use of color]:color:(never always auto)'
-
+    "--hide=[don't list entries matching pattern]:pattern"
     '(--classify -F --indicator-style -p --file-type)'{--classify,-F}'[append file type indicators]'
     '(--file-type -p --indicator-style -F --classify)'{--file-type,-p}'[append file type indicators except *]'
-    '(-F --classify -p --file-type)--indicator-style=:indicator style:(none file-type classify)'
+    '(-F --classify -p --file-type)--indicator-style=:indicator style:(none file-type classify slash)'
 
     '(-f)--full-time[list both full date and full time]'
 
@@ -139,6 +141,11 @@ else
     '(- :)--version[display version information]'
     '*:files:_files'
   )
+  if [[ $OSTYPE = linux* ]]; then
+    arguments+=(
+      '(-Z --context)'{-Z,--context}'[print any security context of each file]'
+    )
+  fi
 fi
 
 _arguments -s $arguments