summary refs log tree commit diff
path: root/Completion/Linux/Command/_losetup
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Linux/Command/_losetup')
-rw-r--r--Completion/Linux/Command/_losetup64
1 files changed, 40 insertions, 24 deletions
diff --git a/Completion/Linux/Command/_losetup b/Completion/Linux/Command/_losetup
index 359a9e0ea..05ef7c56c 100644
--- a/Completion/Linux/Command/_losetup
+++ b/Completion/Linux/Command/_losetup
@@ -1,28 +1,44 @@
-#compdef losetup
-# based on util-linux 2.26.2
+#lcompdef losetup -value-,LOOPDEV_DEBUG,-default-
 
-_arguments -S -A '-*' \
+if [[ $service = *LOOPDEV_DEBUG* ]]; then
+  local expl
+  _wanted values expl value compadd all
+  return
+fi
+
+local device offset
+
+device='1:device:_files -g "/dev/loop<->"'
+offset=( {-o,--offset}'+[specify data start is offset]:offset (bytes)' )
+
+_arguments -s -S \
+  - '(H)'\
+  {-V,--version}'[display version information]' \
+  {-h,--help}'[display help]' \
+  - 'info' \
+  '(-v --verbose)'{-v,--verbose}'[verbose mode]' \
+  '(-o --offset -a --all)'{-a,--all}'[show the status of all loop devices]' \
+  '(-O --output)'{-O+,--output=}'[specify columns to be printed with --list]:column:_sequence -s , compadd - name autoclear back-file back-ino back-maj\:min maj\:min offset partscan ro sizelimit dio' \
+  '(-J --json --raw -O --output -n --noheadings)'{-J,--json}'[use JSON --list output format]' \
   '(-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' \
+  '(-J --json)--raw[raw output format]' \
+  '(-n --noheadings -J --json)'{-n,--noheadings}"[don't print headings in --list output]" \
+  - '(resize)' \
+  {-c,--set-capacity}'[reread the size of the file associated with the loop device]' \
+  - 'detach' \
+  '(-)'{--delete,--detach,-d}'[detach from specified loop device]' \
+  "$device" \
+  - '(detach-all)' \
+  {-D,--detach-all}'[detach all associated loop devices]' \
+  - 'create' \
+  '--direct-io[open backing file with O_DIRECT]::enable:(on off)' \
+  '(-f --find 2)'{-f,--find}'[find the first unused loop device]' \
+  '(-L --nooverlap)'{-L,--nooverlap}'[avoid possible conflict between devices]' \
   '(-P --partscan)'{-P,--partscan}'[scan the partition table of newly created loop devices]' \
-  '--raw[raw output format]' \
+  '--sizelimit[limit device to specified size]:size (bytes)' \
+  '--show[print device name after setup]' \
   '(-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]' \
-  - '(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'
+  '1:file:_files' \
+  - 'assoc' \
+  '(-j --associated)'{-j,--associated}'[show the status of all loop devices associated with an file]:associated file:_files' \
+  "(-f)$device"