summaryrefslogtreecommitdiff
path: root/Completion/Linux/Command/_btrfs
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Linux/Command/_btrfs')
-rw-r--r--Completion/Linux/Command/_btrfs77
1 files changed, 43 insertions, 34 deletions
diff --git a/Completion/Linux/Command/_btrfs b/Completion/Linux/Command/_btrfs
index eb31580ad..65cf067aa 100644
--- a/Completion/Linux/Command/_btrfs
+++ b/Completion/Linux/Command/_btrfs
@@ -17,11 +17,14 @@ cmds_7=( get set list )
cmds_8=( enable disable rescan help )
cmds_9=( assign remove create destroy show limit help )
cmds_10=( start status cancel help )
-cmds_11=( chunk-recover fix-device-size super-recover zero-log )
+cmds_11=( chunk-recover fix-device-size super-recover zero-log create-control-device )
_arguments -C -A "-*" "$args[@]" \
'(- *)--help[print help information]' \
'(- *)--version[print version information]' \
+ '(-v --verbose -q --quiet --help --version)'{-v,--verbose}'[verbose output of operation]' \
+ '(-v --verbose -q --quiet --help --version)'{-q,--quiet}'[suppress all messages except errors]' \
+ '(--help --version)--format=[specify output format]:format:(text json)' \
'(--version)1: :->groups' \
'2: :->cmds' \
'*:: :->args' && ret=0
@@ -60,6 +63,11 @@ while (( $#state )); do
fi
args=( '(-)--help[print help information]' )
case ${cont} in
+ (balance|replace):start|device:(add|delete|remove)|filesystem:resize)
+ args+=(
+ "--enqueue[wait if there's another exclusive operation running, otherwise continue]"
+ )
+ ;|
subvolume:create)
args+=(
'*-i[add the newly created subvolume to a qgroup]:qgroup'
@@ -67,10 +75,10 @@ while (( $#state )); do
)
;;
subvolume:delete)
- args+=(
+ args+=( '!-v' '!--verbose'
'(-c --commit-after -C --commit-each)'{-c,--commit-after}'[wait for transaction commit at the end of the operation]'
'(-c --commit-after -C --commit-each)'{-C,--commit-each}'[wait for transaction commit after deleting each subvolume]'
- '(-v --verbose)'{-v,--verbose}'[verbose output of operations]'
+ '(-i --subvolid)'{-i+,--subvolid=}'[specify id of subvolume to be removed]:subvolume id'
'1:subvolume:_files -/'
)
;;
@@ -112,7 +120,7 @@ while (( $#state )); do
;|
subvolume:sync) args+=( '-s[sleep between checks]:delay (seconds) [1]' );;
subvolume:find-new) args+=( '1:subvol:_files -/' '2:lastgen: _message "last gen"' );;
- (device|filesystem|qgroup|subvolume):(df|du|show|usage))
+ (device|filesystem|qgroup|subvolume):(df|du|show|usage)|scrub:status)
args+=(
'--iec[use 1024 as a base]'
'--si[use 1000 as a base]'
@@ -129,7 +137,7 @@ while (( $#state )); do
'(-t --tbytes)'{-t,--tbytes}'[show sizes in TiB, or TB with --si]'
)
;|
- (filesystem|qgroup):(du|show))
+ (filesystem|qgroup|scrub):(du|show|status))
args+=(
'--raw[output raw numbers in bytes]'
'--human-readable[output human friendly numbers, base 1024]'
@@ -139,17 +147,16 @@ while (( $#state )); do
'--tbytes[show sizes in TiB, or TB with --si]'
)
;|
- filesystem:resize) args+=( '1:size:_guard "(|+|-)[0-9]#[GKM]"' '2:path:->mounts' );;
+ filesystem:resize) args+=( '1: :_numbers -u bytes -N size K M G T P E' '2:path:->mounts' );;
filesystem:defragment)
- args+=(
- '-v[verbose]'
+ args+=( '!-v'
'-r[defragment files recursively]'
'-c+[compress files while defragmenting]::compression algorithm:(zlib lzo zstd)'
'-r[defragment files recursively]'
'-f[flush after defragmenting]'
- '-s[start position]:byte position'
- '-l[defragment limited number of bytes]:length (bytes)'
- '-t[defragment only files over a certain size]:minimum size (bytes) [32M]'
+ '-s[start position]: :_numbers -u bytes -d "beginning of file" offset K M G T P E'
+ '-l[defragment limited number of bytes]: :_numbers -u bytes length K M G T P E'
+ '-t[defragment only extents up to a certain size]: :_numbers -u bytes -d 32M "maximum extent size" K M G T P E'
'*:file:_files'
)
;;
@@ -192,10 +199,9 @@ while (( $#state )); do
;;
device:ready) args+=( '1:device: _files -g "*(-%)"' );;
scrub:(start|resume))
- args+=(
+ args+=( '!-q'
"-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]'
'-R[raw print mode]'
'-c[set ioprio class]:class:(( 0\:none 1\:realtime 2\:best-effort 3\:idle))'
@@ -215,18 +221,17 @@ while (( $#state )); do
)
;;
balance:start)
- args+=(
+ args+=( '!-v' '!--verbose'
'(-m -s)-d+[act on data chunks]:filter:->filters'
'(-d -s)-m+[act on metadata chunks]:filter:->filters'
'(-d -m)-s+[act on system chunks (only under -f)]:filters:->filters'
- '-v[verbose mode]'
'-f[force a reduction of metadata integrity]'
"--full-balance[don't print warning and don't delay start]"
'(--background --bg)'{--background,--bg}'[run balance operation asynchronously in the background]'
'1:path:_files -/'
)
;;
- balance:status) args+=( '-v[verbose mode]' '1:path:_files -/' );;
+ balance:status) args+=( '!-v' '!--verbose' '1:path:_files -/' );;
balance:(pause|cancel|resume)) args+=( '1:path:_files -/' );;
property:set) args+=( '3:value' );&
property:get) args+=( '2:property:(ro label compression)' );&
@@ -244,10 +249,14 @@ while (( $#state )); do
'1:path:_files -/'
)
;;
- qgroup:(assign|remove)) args+=( '1:source path:_files -/'
- '2:destination path:_files -/' '3:path:_files -/' );|
- qgroup:assign) args+=( \!--rescan
- "--no-rescan[don't do a rescan, even if the assignment will make the quotas inconsistent]" )
+ qgroup:(assign|remove))
+ args+=(
+ \!--rescan
+ "--no-rescan[don't do a rescan, even if the quotas may become inconsistent]"
+ '1:source path:_files -/'
+ '2:destination path:_files -/'
+ '3:path:_files -/'
+ )
;;
qgroup:(create|destroy)) args+=( '1:qgroupid:' '2:path:_files -/' );;
qgroup:show)
@@ -296,6 +305,11 @@ while (( $#state )); do
'(-t --tree)'{-t,--tree}'[print only tree with the given id (string or number)]:tree id'
'--follow[use with -b, to show all children tree blocks of the block]'
"--noscan[don't scan devices from the filesystem, use only the listed ones]"
+ '!(--dfs)--bfs'
+ '--dfs[depth-first traversal of the trees]'
+ '--hide-names[hide filenames/subvolume/xattrs and other name references]'
+ '--csum-headers[print node checksums stored in headers (metadata)]'
+ '--csum-items[print checksums stored in checksum items (data)]'
)
;;
inspect*:dump-super)
@@ -307,12 +321,12 @@ while (( $#state )); do
'--bytenr[specify alternate superblock offset]:offset'
)
;;
- inspect*:inode*) args+=( '-v[verbose mode]' '1:inode:_files' '2:path:_files -/' );;
- inspect*:subvol*) args+=( '-v[verbose mode]' '1:subvolid:_guard "[0-9]#" subvolume id' '2:path:_files -/' );;
+ inspect*:inode*) args+=( '!-v' '1:inode:_files' '2:path:_files -/' );;
+ inspect*:subvol*) args+=( '!-v' '1:subvolid:_guard "[0-9]#" subvolume id' '2:path:_files -/' );;
inspect*:logical*)
- args+=(
- '-v[verbose mode]'
+ args+=( '!-v'
'-P[skip the path resolving and print the inodes instead]'
+ '-o[ignore offsets when matching references]'
'-s[specify buffer size]:buffer size [4096]'
'1:logical address:_files'
'2:filesystem path:_files -/'
@@ -322,9 +336,8 @@ while (( $#state )); do
inspect*:rootid) args+=( '1:path:_files -/' );;
inspect*:tree*) args+=( '-b[print raw numbers in bytes]' );;
rescue:(chunk|super)-recover)
- args+=(
+ args+=( '!-v'
'-y[assume yes to every question]'
- '-v[verbose mode]'
'1:device:_files'
)
[[ ${${(P)group}[cmd]} == chunk-recover ]] && args+=('(-)-h[display help]')
@@ -352,12 +365,11 @@ while (( $#state )); do
)
;;
restore)
- args+=(
+ args+=( '!-v' '!--verbose'
'(-s --snapshots)'{-s,--snapshots}'[get snapshots]'
'(-x --xattr)'{-x,--xattr}'[restore extended attributes]'
'(-m --metadata)'{-m,--metadata}'[restore owner, mode and times]'
'(-S --symlink)'{-S,--symlink}'[restore symbolic links]'
- '(-v --verbose)'{-v,--verbose}'[be verbose and output what is restored]'
'(-i --ignore-errors)'{-i,--ignore-errors}'[ignore errors]'
'(-o --overwrite)'{-o,--overwrite}'[overwrite directories and files]'
'-t[specify tree location]:tree root'
@@ -374,23 +386,20 @@ while (( $#state )); do
)
;;
send|receive)
- args+=( '(-q --quiet)'{-q,--quiet}'[suppress all messages except errors]' )
+ args+=( '!-q' '!--quiet' )
;|
send)
- args+=(
- '*-v[verbose mode]'
+ args+=( '!-v'
'-e[if sending multiple subvolumes at once, use the new format]'
'-p[send incremental stream]:parent:_files -/'
'*-c[use snapshot as clone source]:clone:_files -/'
'-f[specify output file]:file:_files'
'--no-data[send in NO_FILE_DATA mode]'
- '(-v --verbose)'{-v,--verbose}'[enable verbose output]'
'1:subvolume:_files -/'
)
;;
receive)
- args+=(
- '*-v[verbose mode]'
+ args+=( '!-v'
'-f[input file]:file: _files'
'-e[terminate after <end cmd>]'
'(-C --chroot)'{-C,--chroot}'[confine the process to destination path using chroot(1)]'