zsh-workers
 help / color / mirror / code / Atom feed
From: llua <llua@gmx.com>
To: zsh-workers@zsh.org
Subject: [PATCH 3/4] _btrfs: updated existing subcommands
Date: Tue, 18 Feb 2014 12:57:00 -0500	[thread overview]
Message-ID: <1392746221-1800-3-git-send-email-llua@gmx.com> (raw)
In-Reply-To: <1392746221-1800-1-git-send-email-llua@gmx.com>

From: Eric Cook <llua@gmx.com>

---
 Completion/Linux/Command/_btrfs | 52 +++++++++++++++++++++++++++++++++--------
 1 file changed, 42 insertions(+), 10 deletions(-)

diff --git a/Completion/Linux/Command/_btrfs b/Completion/Linux/Command/_btrfs
index 3db0578..88443e2 100644
--- a/Completion/Linux/Command/_btrfs
+++ b/Completion/Linux/Command/_btrfs
@@ -1,15 +1,22 @@
 #compdef btrfs
 
 local curcontext="$curcontext" curstate state line expl grp cmd ret=1
-local -a groups args cmds_1 cmds_2 cmds_3 cmds_4 cmds_5 cmds_6
+local -a cmds_1 cmds_2 cmds_3 cmds_4 cmds_5 cmds_6 cmds_7 cmds_8 cmds_9 cmds_10
+local -a groups args
 
-groups=( subvolume filesystem device scrub balance inspect-internal help version )
-cmds_1=( create delete list snapshot get-default set-default find-new help )
+groups=( subvolume filesystem device scrub balance inspect-internal 
+         quota qgroup replace rescue check restore send receive 
+         help version )
+cmds_1=( create delete list snapshot get-default set-default find-new show help )
 cmds_2=( df show sync defragment resize label balance help )
-cmds_3=( add delete scan help )
+cmds_3=( add delete ready scan stats help )
 cmds_4=( start cancel resume status help )
 cmds_5=( start pause cancel resume status )
-cmds_6=( inode-resolve logical-resolve help )
+cmds_6=( inode-resolve logical-resolve subvolid-resolve rootid help )
+cmds_7=( enable disable rescan help )
+cmds_8=( assign remove create destroy show limit help )
+cmds_9=( start status cancel help )
+cmds_10=( chunk-recover super-recover )
 
 [[ $words[2] = h(|e(|l(|p))) ]] && args=( '--full[display detailed help]' )
 
@@ -38,7 +45,7 @@ while (( $#state )); do
     args)
       : $words
       local grp=${groups[(i)$words[1]*]}
-      (( grp && grp < 7 )) || return 1
+      (( grp && grp <= 15 )) || return 1
       local group=cmds_$grp
       local cmd=${${(P)group}[(i)$words[2]*]}
       (( cmd )) || return 1
@@ -60,11 +67,14 @@ while (( $#state )); do
         subvolume:snapshot) args+=( '-r[readonly snapshot]' '1:snapshot:_files -/' );;
         subvolume:list) args+=( '-p[include parent ID in output]' '1:path:->mounts' );;
         subvolume:set-default) args+=( '1:id:_guard "[0-9]#" id' '2:path:->mounts' );;
+        subvolume:get-default) args+=( '1:path:_files -/' );;
+        subvolume:find-new) args+=( '1:subvol:_files -/' '2:lastgen: _message "last gen"' );;
         filesystem:resize) args+=( '1:size:_guard "(|+|-)[0-9]#[GKM]"' '2:path:->mounts' );;
         filesystem:defragment)
           args+=(
             '-v[verbose]'
             '-c[compress files while defragmenting]'
+            '-r[defragment files recursively]'
             '-f[flush after defragmenting]'
             '-s[start position]:byte position'
             '-l[defragment limited number of bytes]:length (bytes)'
@@ -73,18 +83,39 @@ while (( $#state )); do
             )
             ;;
         filesystem:label) args+=( '1:device:_files -g "*(d)"' '2:label' );;
-        filesystem:show) args+=( '(1 -)--all-devices[scan all devices in /dev]' '1: :_guard "^-*" uuid or label' );;
-        device:(add|delete)) args+=( '1:device:_files -g "*(d)"' '2:path:->mounts' );;
+        filesystem:show) 
+          args+=( 
+            '(1 -)'{-d,--all-devices}'[scan all devices in /dev]' 
+            '(1 -)'{-m,--mounted}'[show only mounted filesystems]'
+            '1: :_guard "^-*" uuid or label'
+            )
+            ;;
+        device:(add|delete)) 
+          args+=( 
+            '1:device:_files -g "*(d)"' 
+            '2:path:->mounts'
+            )
+          [[ ${${(P)group}[cmd]} == add ]] && 
+            args+=( 
+              {-K,--nodiscard}'[do not perform discard]'
+              {-f,--force}'[force overwrite of existing filesystem]'
+              )
+            ;;
         device:scan) args+=( '(1 -)--all-devices[scan all devices in /dev]' '1:device:_files -g "*(d)"' );;
+        device:stats) args+=( "1:device or mountpoint:_files -g '*(d,/)'" '-z[reset stats when done]' );;
+        device:ready) args+=( '1:device: _files -g "*(d)"' );;
         scrub:(start|resume))
           args+=(
             "-B[don't background and print statistics at end]"
             '-d[print separate statistics for each device]'
             '-q[omit error message and statistics]'
             '-r[read only mode]'
-            '-u[scrub unused space too]'
+            '-R[raw print mode]'
+            '-c[set ioprio class]:class:(( 0\:none 1\:realtime 2\:best-effort 3\:idle))'
+            '-n[set ioprio classdata]:classdata:(0 1 2 3 4 5 6 7)'
             '1:path or device:_files'
             )
+            [[ ${${(P)group}[cmd]} == start ]] && args+=( '-R[raw print mode]' )
             ;;
         scrub:cancel) args+=( '1:path or device' );;
         scrub:status) args+=( '-d[separate statistics for each device]' '1:path or device:_files' );;
@@ -105,6 +136,7 @@ while (( $#state )); do
           args+=(
             '-v[verbose mode]'
             '-P[skip the path resolving and print the inodes instead]'
+            '-s[buffer size]:buffer size:'
             '1:logical address:_files'
             '2:filesystem path:_files -/'
             )
@@ -136,7 +168,7 @@ while (( $#state )); do
     ;;
     profiles)
       compset -P '*\|'
-      _values -s ',' profile raid0 raid1 raid10 dup single && ret=0
+      _values -s ',' profile raid0 raid1 raid5 raid6 raid10 dup single && ret=0
     ;;
   esac
 done
-- 
1.8.5.3


  parent reply	other threads:[~2014-02-18 18:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-18 17:56 [PATCH 1/4] _btrfs: Removed inconsistent hardtabs llua
2014-02-18 17:56 ` [PATCH 2/4] _btrfs: fix minor typo llua
2014-02-18 17:57 ` llua [this message]
2014-02-18 17:57 ` [PATCH 3/4] _btrfs: updated existing subcommands llua

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1392746221-1800-3-git-send-email-llua@gmx.com \
    --to=llua@gmx.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).