about summary refs log tree commit diff
path: root/Completion/Unix/Command/_cpio
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2014-10-14 23:03:40 +0200
committerOliver Kiddle <opk@zsh.org>2014-10-14 23:04:45 +0200
commit13fc579343b24d298fb8905933b6000d7fcda114 (patch)
treecbc1000696357438714107635f93166bcab76d3a /Completion/Unix/Command/_cpio
parent66320ca93a717467a0ed0d34da4c06257953aa50 (diff)
downloadzsh-13fc579343b24d298fb8905933b6000d7fcda114.tar.gz
zsh-13fc579343b24d298fb8905933b6000d7fcda114.tar.xz
zsh-13fc579343b24d298fb8905933b6000d7fcda114.zip
33467: correct return status on functions and numerous other minor fixes
Diffstat (limited to 'Completion/Unix/Command/_cpio')
-rw-r--r--Completion/Unix/Command/_cpio27
1 files changed, 13 insertions, 14 deletions
diff --git a/Completion/Unix/Command/_cpio b/Completion/Unix/Command/_cpio
index 280a8930f..6b07a214a 100644
--- a/Completion/Unix/Command/_cpio
+++ b/Completion/Unix/Command/_cpio
@@ -1,17 +1,17 @@
 #compdef cpio
 
 local args ig curcontext="$curcontext" state line
-local expl ret
+local expl ret=1
 local fmts='(bar bin odc newc crc tar ustar hpbin hpodc)'
 
 _pick_variant -r ig gnu=GNU unix --version
 
 if (( CURRENT == 2 )); then
-   # Complete arguments 
+   # Complete arguments
    args=('-o[create archive]' '-i[extract from archive]'
    '-p[run as filter on directory tree]')
    [[ $ig = gnu ]] && args=($args '--create[create archive]'
-   '--extract[extract from archive]' 
+   '--extract[extract from archive]'
    '--pass-through[run as filter on directory tree]'
    '--help[show help text]' '--version[show version information]')
 else
@@ -23,13 +23,13 @@ else
 	   "--format=:format type:$fmts"
 	   '--message=:message at end of volume:'
 	   '--null' '--reset-access-time'
-	   '--verbose' '--dot' '--append' 
+	   '--verbose' '--dot' '--append'
 	   '--block-size=:block size in 512 byte units:'
 	   '--dereference'
 	   '--io-size=:block size in bytes'
 	   '--quiet' '--force-local'  '--help'   '--version')
     fi
-    args=($args
+    args+=(
 	  '-A[append files to archive]'
 	  '-B[block size 5120 bytes with special file]'
 	  '-C[set block size per record]:block size in bytes:(8192)'
@@ -44,10 +44,10 @@ else
     if [[ $ig = gnu ]]; then
       args=('--file=:archive file:->afile'
 	    "--format=:format type:$fmts"
-	    '--make-directories' '--nonmatching' 
+	    '--make-directories' '--nonmatching'
             '--preserve-modification-time' '--numeric'
 	    '--rename' '--list' '--swap-bytes' '--swap-halfwords'
-	    '--dot' '--unconditional' '--verbose' 
+	    '--dot' '--unconditional' '--verbose'
 	    '--block-size=:block size in 512 byte units:'
 	    '--swap-halfwords'
 	    '--io-size=:block size in bytes:'
@@ -58,7 +58,7 @@ else
 	    '--no-absolute-filenames' '--sparse' '--only-verify-crc'
 	    '--quiet' '--help' '--version')
     fi
-    args=($args
+    args+=(
 	  '-b[reverse bytes in word]'
 	  '-B[block size 5120 bytes with special file]'
 	  '-d[create directories as needed]'
@@ -87,7 +87,7 @@ else
 	    '--owner=:user (and group) for files:->user'
 	    '--no-preserve-owner' '--sparse'  '--help'  '--version')
     fi
-    args=($args
+    args+=(
 	  '-d[create directories as needed]'
 	  '-l[link files instead of copying]'
 	  '-L[follow symbolic links]'
@@ -98,12 +98,11 @@ else
   else
     return 1
   fi
-  args=($args
+  args+=(
 	'-a[reset access time of input files]'
 	)
-fi 
+fi
 
-ret=1
 _arguments -C -s "$args[@]" && ret=0
 
 if [[ $state = afile ]]; then
@@ -121,12 +120,12 @@ if [[ $state = afile ]]; then
   fi
 elif [[ $state = user ]]; then
   if compset -P '*[:.]'; then
-    _groups
+    _groups && ret=0
   else
     local suf=.
     [[ $OSTYPE = (solaris|hpux)* ]] && suf=:
     compset -S '.*' && unset suf
-    _users -S "$suf" -q
+    _users -S "$suf" -q && ret=0
   fi
 fi