about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Cook <llua@gmx.com>2015-09-20 20:36:09 -0400
committerMikael Magnusson <mikachu@gmail.com>2015-09-23 01:14:08 +0200
commit002d68525c9de1230565d1a1c317996635d39172 (patch)
tree957e5afb804a4dc4a6add23640e84ec1f3b9fcaf
parent0f2f34363d24974dcdcb9aecb03df139969b3d18 (diff)
downloadzsh-002d68525c9de1230565d1a1c317996635d39172.tar.gz
zsh-002d68525c9de1230565d1a1c317996635d39172.tar.xz
zsh-002d68525c9de1230565d1a1c317996635d39172.zip
36571: Completion for zsocket and updated losetup's completion
-rw-r--r--ChangeLog6
-rw-r--r--Completion/Linux/Command/_losetup36
-rw-r--r--Completion/Zsh/Command/_zsocket14
3 files changed, 45 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 6bad31903..f948328a7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-09-23  Mikael Magnusson  <mikachu@gmail.com>
+
+	* Eric Cook: 36571: Completion/Linux/Command/_losetup,
+	Completion/Zsh/Command/_zsocket: Completion for zsocket and
+	updated losetup's completion
+
 2015-09-22  Barton E. Schaefer  <schaefer@zsh.org>
 
 	* 36587: Functions/Zle/edit-command-line: use +LINE:COLUMN to
diff --git a/Completion/Linux/Command/_losetup b/Completion/Linux/Command/_losetup
index ff18681f1..359a9e0ea 100644
--- a/Completion/Linux/Command/_losetup
+++ b/Completion/Linux/Command/_losetup
@@ -1,14 +1,28 @@
 #compdef losetup
+# based on util-linux 2.26.2
 
-local cyphers
-cyphers=( /proc/crypto/cipher/*(N:t) )
-cyphers="${cyphers[@]%-*}"
-
-_arguments -S \
+_arguments -S -A '-*' \
+  '(-l --list)'{-l,--list}'[list currently used loop devices]' \
+  '(-n --noheadings)'{-n,--noheadings}'[do not print heading for --list output]' \
+  '(-d --delete --detach -o --offset -a --all)'{-o,--offset}'+[specify data start is offset]:offset (bytes)' \
+  '(-O --output)'{-O,--output}'[specify columns to be printed with --list]:column: _values -s , column name sizelimit offset autoclear ro back-file' \
+  '(-P --partscan)'{-P,--partscan}'[scan the partition table of newly created loop devices]' \
+  '--raw[raw output format]' \
+  '(-r --read-only)'{-r,--read-only}'[set up a read-only loop device]' \
+  '(-v --verbose)'{-v,--verbose}'[verbose mode]' \
+  '(-V --version)'{-V,--version}'[display version information]' \
+  '(-h --help)'{-h,--help}'[display help]' \
+  '1:device:_files -g "/dev/loop<->"' \
+  '(-d --delete --detach)2:file:_files' \
+  - '(set1)' \
+  '(-o --offset)'{-a,--all}'[show the status of all loop devices]' \
+  - '(set2)' \
+  {-c,--set-capacity}'[reread  the size of the file associated with the loop device]' \
+  - '(set3)' \
   '(- 2)'{--delete,--detach,-d}'[detach from specified loop device]' \
-  '(-d --delete --detach -e --encryption)'{-e,--encryption}"+[enable encryption]:cypher:( $cyphers )" \
-  '(-d --delete --detach -o --offset)'{-o,--offset}'+[specify data start is offset]:offset (bytes)' \
-  '(-d --delete --detach -p --pass-fd)'{-p,--pass-fd}'+[read passphrase from specified file descriptor]:file descriptor:_file_descriptors' \
-  '(-d --delete --detach -k --keybits)'{-k,--keybits}'+[set the number of bits to use in key]:key size:(64 128 160 192 256)' \
-  '1:device:_files -g "loop*(-.)"' \
-  '(-d --delete --detach)2:file:_files'
+  - '(set4)' \
+  '(-D --detach-all)'{-D,--detach-all}'[detach all associated loop devices]' \
+  - '(set5)' \
+  {-f,--find}'[find the first unused loop device]' \
+  - '(set6)' \
+  {-j,--associated}'[show the status of all loop devices associated with an file]: : _files'
diff --git a/Completion/Zsh/Command/_zsocket b/Completion/Zsh/Command/_zsocket
new file mode 100644
index 000000000..eeed9f1d8
--- /dev/null
+++ b/Completion/Zsh/Command/_zsocket
@@ -0,0 +1,14 @@
+#compdef zsocket
+
+_arguments -s -w -A "-*" \
+  '-v[verbose output]' \
+  '-d[target file descriptor]:fd:_file_descriptors' \
+  - outbound \
+  '1: :_files' \
+  - listen \
+  '-l[open a socket listening]' \
+  '1: :_files' \
+  - accept \
+  '-a[accept an incoming connection]' \
+  '-t[return if no incoming connections are pending]' \
+  '1:fd:{ (( words[(I)-*a*] )) && _file_descriptors }'