#compdef bcachefs

autoload -U is-at-least

_bcachefs() {
    typeset -A opt_args
    typeset -a _arguments_options
    local ret=1

    if is-at-least 5.2; then
        _arguments_options=(-s -S -C)
    else
        _arguments_options=(-s -C)
    fi

    local context curcontext="$curcontext" state line
    _arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
":: :_bcachefs_commands" \
"*::: :->bcachefs" \
&& ret=0
    case $state in
    (bcachefs)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:bcachefs-command-$line[1]:"
        case $line[1] in
            (format)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(show-super)
_arguments "${_arguments_options[@]}" : \
'-f+[Superblock fields to print (comma-separated, or "all")]:FIELDS: ' \
'--fields=[Superblock fields to print (comma-separated, or "all")]:FIELDS: ' \
'-F+[Print a single superblock field only (no header)]:FIELD_ONLY: ' \
'--field-only=[Print a single superblock field only (no header)]:FIELD_ONLY: ' \
'--help[Print help]' \
'-l[Print superblock layout]' \
'--layout[Print superblock layout]' \
':device -- Device path:' \
&& ret=0
;;
(recover-super)
_arguments "${_arguments_options[@]}" : \
'-d+[Size of filesystem on device, in bytes]:DEV_SIZE: ' \
'--dev_size=[Size of filesystem on device, in bytes]:DEV_SIZE: ' \
'-o+[Offset to probe, in bytes (must be a multiple of 512)]:OFFSET: ' \
'--offset=[Offset to probe, in bytes (must be a multiple of 512)]:OFFSET: ' \
'-l+[Length in bytes to scan from start and end of device]:SCAN_LEN: ' \
'--scan_len=[Length in bytes to scan from start and end of device]:SCAN_LEN: ' \
'-s+[Member device to recover from, in a multi-device fs]:SRC_DEVICE: ' \
'--src_device=[Member device to recover from, in a multi-device fs]:SRC_DEVICE: ' \
'-i+[Index of this device, if recovering from another device]:DEV_IDX: ' \
'--dev_idx=[Index of this device, if recovering from another device]:DEV_IDX: ' \
'-y[Recover without prompting]' \
'--yes[Recover without prompting]' \
'-v[Increase logging level]' \
'--verbose[Increase logging level]' \
'-h[Print help]' \
'--help[Print help]' \
':device -- Device to recover:' \
&& ret=0
;;
(set-fs-option)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(reset-counters)
_arguments "${_arguments_options[@]}" : \
'-c+[Reset specific counters (comma-separated), not all]:COUNTERS: ' \
'--counters=[Reset specific counters (comma-separated), not all]:COUNTERS: ' \
'--counter=[Reset specific counters (comma-separated), not all]:COUNTERS: ' \
'-h[Print help]' \
'--help[Print help]' \
':device -- Device path:' \
&& ret=0
;;
(strip-alloc)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'*::devices -- Device(s) to strip:_files' \
&& ret=0
;;
(image)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
":: :_bcachefs__image_commands" \
"*::: :->image" \
&& ret=0

    case $state in
    (image)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:bcachefs-image-command-$line[1]:"
        case $line[1] in
            (create)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(update)
_arguments "${_arguments_options[@]}" : \
'-s+[Source directory]:SOURCE: ' \
'--source=[Source directory]:SOURCE: ' \
'-a[Include allocation info in the filesystem]' \
'--keep-alloc[Include allocation info in the filesystem]' \
'-q[Only print errors]' \
'--quiet[Only print errors]' \
'*-v[Verbose filesystem initialization]' \
'*--verbose[Verbose filesystem initialization]' \
'-h[Print help]' \
'--help[Print help]' \
':image -- Image file to update:' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_bcachefs__image__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:bcachefs-image-help-command-$line[1]:"
        case $line[1] in
            (create)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(update)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(mount)
_arguments "${_arguments_options[@]}" : \
'-f+[Path to passphrase file]:PASSPHRASE_FILE:_files' \
'--passphrase-file=[Path to passphrase file]:PASSPHRASE_FILE:_files' \
'-k+[Passphrase policy to use in case of an encrypted filesystem. If not specified, the password will be searched for in the keyring. If not found, the password will be prompted or read from stdin, depending on whether the stdin is connected to a terminal or not]:UNLOCK_POLICY:((fail\:"Don'\''t ask for passphrase, if the key cannot be found in the keyring just fail"
wait\:"Wait for passphrase to become available before mounting"
ask\:"Interactively prompt the user for a passphrase"
stdin\:"Try to read the passphrase from \`stdin\` without prompting"))' \
'--key_location=[Passphrase policy to use in case of an encrypted filesystem. If not specified, the password will be searched for in the keyring. If not found, the password will be prompted or read from stdin, depending on whether the stdin is connected to a terminal or not]:UNLOCK_POLICY:((fail\:"Don'\''t ask for passphrase, if the key cannot be found in the keyring just fail"
wait\:"Wait for passphrase to become available before mounting"
ask\:"Interactively prompt the user for a passphrase"
stdin\:"Try to read the passphrase from \`stdin\` without prompting"))' \
'-o+[Mount options]:OPTIONS: ' \
'-t+[]:FS_TYPE: ' \
'--type=[]:FS_TYPE: ' \
'-c+[Force color on/off. Autodetect tty is used to define default\:]:COLORIZE:(true false)' \
'--colorize=[Force color on/off. Autodetect tty is used to define default\:]:COLORIZE:(true false)' \
'*-v[Verbose mode]' \
'*--verbose[Verbose mode]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
':dev -- Device, or UUID=\<UUID\>:' \
'::mountpoint -- Where the filesystem should be mounted. If not set, then the filesystem won'\''t actually be mounted. But all steps preceeding mounting the filesystem (e.g. asking for passphrase) will still be performed:_files' \
&& ret=0
;;
(fusemount)
_arguments "${_arguments_options[@]}" : \
'-o+[Mount options (-o key=value,...)]:OPTIONS: ' \
'-f[Run in foreground]' \
'-h[Print help]' \
'--help[Print help]' \
':device -- Device(s) to mount (dev1\:dev2\:...):' \
':mountpoint -- Mountpoint:' \
&& ret=0
;;
(fsck)
_arguments "${_arguments_options[@]}" : \
'*-o+[Additional mount options]:OPTS: ' \
'-p[Automatic repair (no questions)]' \
'-n[Don'\''t repair, only check for errors]' \
'-y[Assume "yes" to all questions]' \
'-f[Force checking even if filesystem is marked clean]' \
'-r[Don'\''t display more than 10 errors of a given type]' \
'--ratelimit_errors[Don'\''t display more than 10 errors of a given type]' \
'-k[Use the in-kernel fsck implementation]' \
'--kernel[Use the in-kernel fsck implementation]' \
'-K[Don'\''t use the in-kernel fsck implementation]' \
'--no-kernel[Don'\''t use the in-kernel fsck implementation]' \
'-v[Be verbose]' \
'-h[Print help]' \
'--help[Print help]' \
'*::devices -- Device path(s):' \
&& ret=0
;;
(recovery-pass)
_arguments "${_arguments_options[@]}" : \
'*-s+[Schedule a recovery pass]:SET: ' \
'*--set=[Schedule a recovery pass]:SET: ' \
'*-u+[Deschedule a recovery pass]:UNSET: ' \
'*--unset=[Deschedule a recovery pass]:UNSET: ' \
'-h[Print help]' \
'--help[Print help]' \
'*::devices -- Device path(s):' \
&& ret=0
;;
(fs)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
":: :_bcachefs__fs_commands" \
"*::: :->fs" \
&& ret=0

    case $state in
    (fs)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:bcachefs-fs-command-$line[1]:"
        case $line[1] in
            (usage)
_arguments "${_arguments_options[@]}" : \
'*-f+[Comma-separated list of fields]:FIELDS:(replicas btree compression rebalance_work devices)' \
'*--fields=[Comma-separated list of fields]:FIELDS:(replicas btree compression rebalance_work devices)' \
'--help[Print help]' \
'-a[Print all accounting fields]' \
'--all[Print all accounting fields]' \
'-h[Human-readable units]' \
'--human-readable[Human-readable units]' \
'*::mountpoints -- Filesystem mountpoints:' \
&& ret=0
;;
(top)
_arguments "${_arguments_options[@]}" : \
'--help[Print help]' \
'-h[Human-readable units]' \
'--human-readable[Human-readable units]' \
'::filesystem -- Filesystem path, device, or UUID (default\: current directory):' \
&& ret=0
;;
(timestats)
_arguments "${_arguments_options[@]}" : \
'-s+[Sort by column]:SORT:(name count dur-min dur-max dur-total mean-since mean-recent stddev-since stddev-recent)' \
'--sort=[Sort by column]:SORT:(name count dur-min dur-max dur-total mean-since mean-recent stddev-since stddev-recent)' \
'-i+[Refresh interval in seconds (interactive mode)]:INTERVAL: ' \
'--interval=[Refresh interval in seconds (interactive mode)]:INTERVAL: ' \
'-a[Show stats with zero count]' \
'--all[Show stats with zero count]' \
'--json[Output raw JSON]' \
'--no-device-stats[Skip per-device IO latency stats]' \
'--once[One-shot output (no interactive TUI)]' \
'-h[Print help]' \
'--help[Print help]' \
'::filesystem -- Filesystem UUID, device, or mount point (default\: all):' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_bcachefs__fs__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:bcachefs-fs-help-command-$line[1]:"
        case $line[1] in
            (usage)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(top)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(timestats)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(device)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
":: :_bcachefs__device_commands" \
"*::: :->device" \
&& ret=0

    case $state in
    (device)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:bcachefs-device-command-$line[1]:"
        case $line[1] in
            (add)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(online)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
':device -- Device path:' \
&& ret=0
;;
(offline)
_arguments "${_arguments_options[@]}" : \
'-f[Force, if data redundancy will be degraded]' \
'--force[Force, if data redundancy will be degraded]' \
'-h[Print help]' \
'--help[Print help]' \
':device -- Device path:' \
&& ret=0
;;
(remove)
_arguments "${_arguments_options[@]}" : \
'-f[Force removal, even if some data couldn'\''t be migrated]' \
'--force[Force removal, even if some data couldn'\''t be migrated]' \
'-F[Force removal, even if some metadata couldn'\''t be migrated]' \
'--force-metadata[Force removal, even if some metadata couldn'\''t be migrated]' \
'-h[Print help]' \
'--help[Print help]' \
':device -- Device path or numeric device index:' \
'::path -- Filesystem path (required when specifying device by index):' \
&& ret=0
;;
(evacuate)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
':device -- Device path:' \
&& ret=0
;;
(set-state)
_arguments "${_arguments_options[@]}" : \
'-f[Force if data redundancy will be degraded]' \
'--force[Force if data redundancy will be degraded]' \
'-F[Force even if data will be lost]' \
'--force-if-data-lost[Force even if data will be lost]' \
'-o[Set state of an offline device]' \
'--offline[Set state of an offline device]' \
'-h[Print help]' \
'--help[Print help]' \
':new_state -- Device state:(rw ro evacuating spare)' \
':device -- Device path or numeric device index:' \
'::path -- Filesystem path (required when specifying device by index):' \
&& ret=0
;;
(resize)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
':device -- Device path:' \
'::size -- New size (human-readable, e.g. 1G); defaults to device size:' \
&& ret=0
;;
(resize-journal)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
':device -- Device path:' \
':size -- New journal size (human-readable, e.g. 1G):' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_bcachefs__device__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:bcachefs-device-help-command-$line[1]:"
        case $line[1] in
            (add)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(online)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(offline)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(remove)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(evacuate)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(set-state)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(resize)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(resize-journal)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(subvolume)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
":: :_bcachefs__subvolume_commands" \
"*::: :->subvolume" \
&& ret=0

    case $state in
    (subvolume)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:bcachefs-subvolume-command-$line[1]:"
        case $line[1] in
            (create)
_arguments "${_arguments_options[@]}" : \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::targets -- Paths:_files' \
&& ret=0
;;
(new)
_arguments "${_arguments_options[@]}" : \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::targets -- Paths:_files' \
&& ret=0
;;
(delete)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'*::targets -- Path:_files' \
&& ret=0
;;
(del)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'*::targets -- Path:_files' \
&& ret=0
;;
(snapshot)
_arguments "${_arguments_options[@]}" : \
'-r[Make snapshot read only]' \
'--read-only[Make snapshot read only]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::source:_files' \
':dest:_files' \
&& ret=0
;;
(snap)
_arguments "${_arguments_options[@]}" : \
'-r[Make snapshot read only]' \
'--read-only[Make snapshot read only]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::source:_files' \
':dest:_files' \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
'--sort=[Sort order]:SORT:(name size time)' \
'--json[Output as JSON]' \
'-t[Show subvolume tree structure (implies -R)]' \
'--tree[Show subvolume tree structure (implies -R)]' \
'-R[List subvolumes recursively]' \
'--recursive[List subvolumes recursively]' \
'-s[Include snapshot subvolumes]' \
'--snapshots[Include snapshot subvolumes]' \
'--readonly[Only show read-only subvolumes]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':target -- Filesystem (device, mountpoint, or UUID):_files' \
&& ret=0
;;
(ls)
_arguments "${_arguments_options[@]}" : \
'--sort=[Sort order]:SORT:(name size time)' \
'--json[Output as JSON]' \
'-t[Show subvolume tree structure (implies -R)]' \
'--tree[Show subvolume tree structure (implies -R)]' \
'-R[List subvolumes recursively]' \
'--recursive[List subvolumes recursively]' \
'-s[Include snapshot subvolumes]' \
'--snapshots[Include snapshot subvolumes]' \
'--readonly[Only show read-only subvolumes]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':target -- Filesystem (device, mountpoint, or UUID):_files' \
&& ret=0
;;
(list-snapshots)
_arguments "${_arguments_options[@]}" : \
'--sort=[Sort order (flat view only)]:SORT:(name size time)' \
'-f[Show flat list instead of tree]' \
'--flat[Show flat list instead of tree]' \
'--json[Output as JSON]' \
'--readonly[Only show read-only snapshots (flat view only)]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':target -- Filesystem (device, mountpoint, or UUID):_files' \
&& ret=0
;;
(ls-snap)
_arguments "${_arguments_options[@]}" : \
'--sort=[Sort order (flat view only)]:SORT:(name size time)' \
'-f[Show flat list instead of tree]' \
'--flat[Show flat list instead of tree]' \
'--json[Output as JSON]' \
'--readonly[Only show read-only snapshots (flat view only)]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':target -- Filesystem (device, mountpoint, or UUID):_files' \
&& ret=0
;;
(list-snap)
_arguments "${_arguments_options[@]}" : \
'--sort=[Sort order (flat view only)]:SORT:(name size time)' \
'-f[Show flat list instead of tree]' \
'--flat[Show flat list instead of tree]' \
'--json[Output as JSON]' \
'--readonly[Only show read-only snapshots (flat view only)]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':target -- Filesystem (device, mountpoint, or UUID):_files' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_bcachefs__subvolume__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:bcachefs-subvolume-help-command-$line[1]:"
        case $line[1] in
            (create)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(delete)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(snapshot)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(list-snapshots)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(reconcile)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
":: :_bcachefs__reconcile_commands" \
"*::: :->reconcile" \
&& ret=0

    case $state in
    (reconcile)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:bcachefs-reconcile-command-$line[1]:"
        case $line[1] in
            (status)
_arguments "${_arguments_options[@]}" : \
'*-t+[Reconcile types to display (comma-separated)]:TYPES:(replicas checksum erasure_code compression target high_priority pending stripes)' \
'*--types=[Reconcile types to display (comma-separated)]:TYPES:(replicas checksum erasure_code compression target high_priority pending stripes)' \
'--help[Print help]' \
'::filesystem -- Filesystem mountpoint:' \
&& ret=0
;;
(wait)
_arguments "${_arguments_options[@]}" : \
'*-t+[Reconcile types to wait on (comma-separated)]:TYPES:(replicas checksum erasure_code compression target high_priority pending stripes)' \
'*--types=[Reconcile types to wait on (comma-separated)]:TYPES:(replicas checksum erasure_code compression target high_priority pending stripes)' \
'--help[Print help]' \
'::filesystem -- Filesystem mountpoint:' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_bcachefs__reconcile__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:bcachefs-reconcile-help-command-$line[1]:"
        case $line[1] in
            (status)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(wait)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(scrub)
_arguments "${_arguments_options[@]}" : \
'-m[Check metadata only]' \
'--metadata[Check metadata only]' \
'-h[Print help]' \
'--help[Print help]' \
':filesystem -- Filesystem path or device:' \
&& ret=0
;;
(unlock)
_arguments "${_arguments_options[@]}" : \
'-k+[Keyring to add to]:KEYRING:(session user user_session)' \
'--keyring=[Keyring to add to]:KEYRING:(session user user_session)' \
'-f+[Passphrase file to read from (disables passphrase prompt)]:FILE:_files' \
'--file=[Passphrase file to read from (disables passphrase prompt)]:FILE:_files' \
'-c[Check if a device is encrypted]' \
'--check[Check if a device is encrypted]' \
'-h[Print help]' \
'--help[Print help]' \
':device -- Device:' \
&& ret=0
;;
(set-passphrase)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'*::devices -- Devices (colon-separated or multiple arguments):' \
&& ret=0
;;
(remove-passphrase)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'*::devices -- Devices (colon-separated or multiple arguments):' \
&& ret=0
;;
(migrate)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(migrate-superblock)
_arguments "${_arguments_options[@]}" : \
'-d+[Device to create superblock for]:DEVICE: ' \
'--dev=[Device to create superblock for]:DEVICE: ' \
'-o+[Offset of existing superblock]:OFFSET: ' \
'--offset=[Offset of existing superblock]:OFFSET: ' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(set-file-option)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(reflink-option-propagate)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(dump)
_arguments "${_arguments_options[@]}" : \
'-o+[Output filename (without .qcow2 extension)]:OUTPUT: ' \
'-s+[Sanitize inline data and optionally filenames (data or filenames)]' \
'--sanitize=[Sanitize inline data and optionally filenames (data or filenames)]' \
'-f[Force; overwrite existing files]' \
'--force[Force; overwrite existing files]' \
'--nojournal[Don'\''t dump entire journal, just dirty entries]' \
'--noexcl[Open devices without O_EXCL]' \
'-v[Verbose output]' \
'--verbose[Verbose output]' \
'-h[Print help]' \
'--help[Print help]' \
'*::devices -- Devices to dump:' \
&& ret=0
;;
(undump)
_arguments "${_arguments_options[@]}" : \
'-f[Overwrite existing output files]' \
'--force[Overwrite existing output files]' \
'-h[Print help]' \
'--help[Print help]' \
'*::files -- qcow2 files to convert:' \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
'-m+[]:MODE:(keys formats nodes nodes-ondisk)' \
'--mode=[]:MODE:(keys formats nodes nodes-ondisk)' \
'-b+[Btree to list from]:BTREE: ' \
'--btree=[Btree to list from]:BTREE: ' \
'-k+[Bkey type to list]:BKEY_TYPE: ' \
'--bkey-type=[Bkey type to list]:BKEY_TYPE: ' \
'-l+[Btree depth to descend to (0 == leaves)]:LEVEL: ' \
'--level=[Btree depth to descend to (0 == leaves)]:LEVEL: ' \
'-s+[Start position to list from]:START: ' \
'--start=[Start position to list from]:START: ' \
'-e+[End position]:END: ' \
'--end=[End position]:END: ' \
'-c+[Force color on/off. Default\: autodetect tty]:COLORIZE:(true false)' \
'--colorize=[Force color on/off. Default\: autodetect tty]:COLORIZE:(true false)' \
'-f[Check (fsck) the filesystem first]' \
'--fsck[Check (fsck) the filesystem first]' \
'*-v[Verbose mode]' \
'*--verbose[Verbose mode]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::devices:_files' \
&& ret=0
;;
(list_journal)
_arguments "${_arguments_options[@]}" : \
'-n+[Number of journal entries to print]:NR_ENTRIES: ' \
'--nr-entries=[Number of journal entries to print]:NR_ENTRIES: ' \
'-s+[Sequence number or range (seq or seq..seq)]:SEQ: ' \
'--seq=[Sequence number or range (seq or seq..seq)]:SEQ: ' \
'*-o+[Additional mount options]:OPTS: ' \
'-b+[Filter by btree (+/-btree1,btree2)]:BTREE: ' \
'--btree=[Filter by btree (+/-btree1,btree2)]:BTREE: ' \
'-t+[Filter transactions by function (+/-fn1,fn2)]:TRANSACTION: ' \
'--transaction=[Filter transactions by function (+/-fn1,fn2)]:TRANSACTION: ' \
'*-k+[Filter by key range (+/-bbpos\[-bbpos\],...)]:KEY: ' \
'*--key=[Filter by key range (+/-bbpos\[-bbpos\],...)]:KEY: ' \
'-V+[Print bkey values (true/false)]:BKEY_VAL: ' \
'--bkey-val=[Print bkey values (true/false)]:BKEY_VAL: ' \
'-a[Read entire journal, not just contiguous entries]' \
'--all[Read entire journal, not just contiguous entries]' \
'-d[Only read dirty entries]' \
'--dirty-only[Only read dirty entries]' \
'-B[Include blacklisted entries]' \
'--blacklisted[Include blacklisted entries]' \
'-F[Only flush entries]' \
'--flush-only[Only flush entries]' \
'-D[Datetime entries only]' \
'--datetime[Datetime entries only]' \
'-H[Headers only]' \
'--headers-only[Headers only]' \
'--all-headers[Print all headers even if no transactions matched]' \
'-l[Include log-only entries when filtering]' \
'--log[Include log-only entries when filtering]' \
'-L[Only print transactions containing log messages]' \
'--log-only[Only print transactions containing log messages]' \
'-O[Print offset of each subentry]' \
'--offset[Print offset of each subentry]' \
'-v[Verbose mode]' \
'--verbose[Verbose mode]' \
'-h[Print help]' \
'--help[Print help]' \
'*::devices -- Devices:' \
&& ret=0
;;
(kill_btree_node)
_arguments "${_arguments_options[@]}" : \
'*-n+[Node to kill (btree\:level\:idx)]:NODES: ' \
'*--node=[Node to kill (btree\:level\:idx)]:NODES: ' \
'-d+[Device index (default\: kill all replicas)]:DEV: ' \
'--dev=[Device index (default\: kill all replicas)]:DEV: ' \
'-h[Print help]' \
'--help[Print help]' \
'*::devices -- Device(s):_files' \
&& ret=0
;;
(data-read)
_arguments "${_arguments_options[@]}" : \
'--offset=[Offset in bytes (must be sector-aligned)]:OFFSET: ' \
'--len=[Length in bytes (must be sector-aligned, default\: one page)]:LEN: ' \
'--output=[Write raw data to this file instead of hex dump]:OUTPUT: ' \
'--width=[Hex dump width]:WIDTH: ' \
'--no-poison-check[Bypass poison checks (read data even from poisoned extents)]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':file -- File to read:' \
&& ret=0
;;
(unpoison)
_arguments "${_arguments_options[@]}" : \
'--offset=[Start offset in bytes (must be sector-aligned)]:OFFSET: ' \
'--len=[Length in bytes (must be sector-aligned, 0 = entire file)]:LEN: ' \
'--yes-i-understand[Required to confirm you understand the risks]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':file -- File to unpoison:' \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
':shell:(bash elvish fish powershell zsh)' \
&& ret=0
;;
(version)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_bcachefs__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:bcachefs-help-command-$line[1]:"
        case $line[1] in
            (format)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(show-super)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(recover-super)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(set-fs-option)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(reset-counters)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(strip-alloc)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(image)
_arguments "${_arguments_options[@]}" : \
":: :_bcachefs__help__image_commands" \
"*::: :->image" \
&& ret=0

    case $state in
    (image)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:bcachefs-help-image-command-$line[1]:"
        case $line[1] in
            (create)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(update)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(mount)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(fusemount)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(fsck)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(recovery-pass)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(fs)
_arguments "${_arguments_options[@]}" : \
":: :_bcachefs__help__fs_commands" \
"*::: :->fs" \
&& ret=0

    case $state in
    (fs)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:bcachefs-help-fs-command-$line[1]:"
        case $line[1] in
            (usage)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(top)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(timestats)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(device)
_arguments "${_arguments_options[@]}" : \
":: :_bcachefs__help__device_commands" \
"*::: :->device" \
&& ret=0

    case $state in
    (device)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:bcachefs-help-device-command-$line[1]:"
        case $line[1] in
            (add)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(online)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(offline)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(remove)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(evacuate)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(set-state)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(resize)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(resize-journal)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(subvolume)
_arguments "${_arguments_options[@]}" : \
":: :_bcachefs__help__subvolume_commands" \
"*::: :->subvolume" \
&& ret=0

    case $state in
    (subvolume)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:bcachefs-help-subvolume-command-$line[1]:"
        case $line[1] in
            (create)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(delete)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(snapshot)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(list-snapshots)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(reconcile)
_arguments "${_arguments_options[@]}" : \
":: :_bcachefs__help__reconcile_commands" \
"*::: :->reconcile" \
&& ret=0

    case $state in
    (reconcile)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:bcachefs-help-reconcile-command-$line[1]:"
        case $line[1] in
            (status)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(wait)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(scrub)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(unlock)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(set-passphrase)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(remove-passphrase)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(migrate)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(migrate-superblock)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(set-file-option)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(reflink-option-propagate)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(dump)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(undump)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(list_journal)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(kill_btree_node)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(data-read)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(unpoison)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(version)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_bcachefs_commands] )) ||
_bcachefs_commands() {
    local commands; commands=(
'format:Format a new filesystem' \
'show-super:Print superblock information' \
'recover-super:Recover damaged superblock' \
'set-fs-option:Set filesystem options' \
'reset-counters:Reset filesystem counters' \
'strip-alloc:Strip alloc info for read-only use' \
'image:Filesystem image commands' \
'mount:Mount a filesystem' \
'fusemount:FUSE mount' \
'fsck:Check filesystem consistency' \
'recovery-pass:Manage recovery passes' \
'fs:Manage a running filesystem' \
'device:Manage devices within a filesystem' \
'subvolume:Manage subvolumes and snapshots' \
'reconcile:Reconcile filesystem data' \
'scrub:Verify data checksums' \
'unlock:Unlock an encrypted filesystem' \
'set-passphrase:Set or change passphrase' \
'remove-passphrase:Remove passphrase' \
'migrate:Migrate existing filesystem to bcachefs' \
'migrate-superblock:Move superblock to standard location' \
'set-file-option:Set file-level options' \
'reflink-option-propagate:Propagate options to reflinked files' \
'dump:Dump filesystem metadata' \
'undump:Restore dumped metadata' \
'list:List filesystem metadata' \
'list_journal:List journal entries' \
'kill_btree_node:Remove a btree node' \
'data-read:Read data with extended error info' \
'unpoison:Clear poison flags on file extents' \
'completions:Generate shell completions' \
'version:Display version' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'bcachefs commands' commands "$@"
}
(( $+functions[_bcachefs__completions_commands] )) ||
_bcachefs__completions_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs completions commands' commands "$@"
}
(( $+functions[_bcachefs__data-read_commands] )) ||
_bcachefs__data-read_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs data-read commands' commands "$@"
}
(( $+functions[_bcachefs__device_commands] )) ||
_bcachefs__device_commands() {
    local commands; commands=(
'add:Add a device to a filesystem' \
'online:Bring a device online' \
'offline:Take a device offline' \
'remove:Remove a device' \
'evacuate:Evacuate data from a device' \
'set-state:Set device state' \
'resize:Resize filesystem on a device' \
'resize-journal:Resize journal on a device' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'bcachefs device commands' commands "$@"
}
(( $+functions[_bcachefs__device__add_commands] )) ||
_bcachefs__device__add_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs device add commands' commands "$@"
}
(( $+functions[_bcachefs__device__evacuate_commands] )) ||
_bcachefs__device__evacuate_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs device evacuate commands' commands "$@"
}
(( $+functions[_bcachefs__device__help_commands] )) ||
_bcachefs__device__help_commands() {
    local commands; commands=(
'add:Add a device to a filesystem' \
'online:Bring a device online' \
'offline:Take a device offline' \
'remove:Remove a device' \
'evacuate:Evacuate data from a device' \
'set-state:Set device state' \
'resize:Resize filesystem on a device' \
'resize-journal:Resize journal on a device' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'bcachefs device help commands' commands "$@"
}
(( $+functions[_bcachefs__device__help__add_commands] )) ||
_bcachefs__device__help__add_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs device help add commands' commands "$@"
}
(( $+functions[_bcachefs__device__help__evacuate_commands] )) ||
_bcachefs__device__help__evacuate_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs device help evacuate commands' commands "$@"
}
(( $+functions[_bcachefs__device__help__help_commands] )) ||
_bcachefs__device__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs device help help commands' commands "$@"
}
(( $+functions[_bcachefs__device__help__offline_commands] )) ||
_bcachefs__device__help__offline_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs device help offline commands' commands "$@"
}
(( $+functions[_bcachefs__device__help__online_commands] )) ||
_bcachefs__device__help__online_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs device help online commands' commands "$@"
}
(( $+functions[_bcachefs__device__help__remove_commands] )) ||
_bcachefs__device__help__remove_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs device help remove commands' commands "$@"
}
(( $+functions[_bcachefs__device__help__resize_commands] )) ||
_bcachefs__device__help__resize_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs device help resize commands' commands "$@"
}
(( $+functions[_bcachefs__device__help__resize-journal_commands] )) ||
_bcachefs__device__help__resize-journal_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs device help resize-journal commands' commands "$@"
}
(( $+functions[_bcachefs__device__help__set-state_commands] )) ||
_bcachefs__device__help__set-state_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs device help set-state commands' commands "$@"
}
(( $+functions[_bcachefs__device__offline_commands] )) ||
_bcachefs__device__offline_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs device offline commands' commands "$@"
}
(( $+functions[_bcachefs__device__online_commands] )) ||
_bcachefs__device__online_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs device online commands' commands "$@"
}
(( $+functions[_bcachefs__device__remove_commands] )) ||
_bcachefs__device__remove_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs device remove commands' commands "$@"
}
(( $+functions[_bcachefs__device__resize_commands] )) ||
_bcachefs__device__resize_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs device resize commands' commands "$@"
}
(( $+functions[_bcachefs__device__resize-journal_commands] )) ||
_bcachefs__device__resize-journal_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs device resize-journal commands' commands "$@"
}
(( $+functions[_bcachefs__device__set-state_commands] )) ||
_bcachefs__device__set-state_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs device set-state commands' commands "$@"
}
(( $+functions[_bcachefs__dump_commands] )) ||
_bcachefs__dump_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs dump commands' commands "$@"
}
(( $+functions[_bcachefs__format_commands] )) ||
_bcachefs__format_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs format commands' commands "$@"
}
(( $+functions[_bcachefs__fs_commands] )) ||
_bcachefs__fs_commands() {
    local commands; commands=(
'usage:Show filesystem disk usage' \
'top:Show live performance counters' \
'timestats:Show operation latency statistics' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'bcachefs fs commands' commands "$@"
}
(( $+functions[_bcachefs__fs__help_commands] )) ||
_bcachefs__fs__help_commands() {
    local commands; commands=(
'usage:Show filesystem disk usage' \
'top:Show live performance counters' \
'timestats:Show operation latency statistics' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'bcachefs fs help commands' commands "$@"
}
(( $+functions[_bcachefs__fs__help__help_commands] )) ||
_bcachefs__fs__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs fs help help commands' commands "$@"
}
(( $+functions[_bcachefs__fs__help__timestats_commands] )) ||
_bcachefs__fs__help__timestats_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs fs help timestats commands' commands "$@"
}
(( $+functions[_bcachefs__fs__help__top_commands] )) ||
_bcachefs__fs__help__top_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs fs help top commands' commands "$@"
}
(( $+functions[_bcachefs__fs__help__usage_commands] )) ||
_bcachefs__fs__help__usage_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs fs help usage commands' commands "$@"
}
(( $+functions[_bcachefs__fs__timestats_commands] )) ||
_bcachefs__fs__timestats_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs fs timestats commands' commands "$@"
}
(( $+functions[_bcachefs__fs__top_commands] )) ||
_bcachefs__fs__top_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs fs top commands' commands "$@"
}
(( $+functions[_bcachefs__fs__usage_commands] )) ||
_bcachefs__fs__usage_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs fs usage commands' commands "$@"
}
(( $+functions[_bcachefs__fsck_commands] )) ||
_bcachefs__fsck_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs fsck commands' commands "$@"
}
(( $+functions[_bcachefs__fusemount_commands] )) ||
_bcachefs__fusemount_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs fusemount commands' commands "$@"
}
(( $+functions[_bcachefs__help_commands] )) ||
_bcachefs__help_commands() {
    local commands; commands=(
'format:Format a new filesystem' \
'show-super:Print superblock information' \
'recover-super:Recover damaged superblock' \
'set-fs-option:Set filesystem options' \
'reset-counters:Reset filesystem counters' \
'strip-alloc:Strip alloc info for read-only use' \
'image:Filesystem image commands' \
'mount:Mount a filesystem' \
'fusemount:FUSE mount' \
'fsck:Check filesystem consistency' \
'recovery-pass:Manage recovery passes' \
'fs:Manage a running filesystem' \
'device:Manage devices within a filesystem' \
'subvolume:Manage subvolumes and snapshots' \
'reconcile:Reconcile filesystem data' \
'scrub:Verify data checksums' \
'unlock:Unlock an encrypted filesystem' \
'set-passphrase:Set or change passphrase' \
'remove-passphrase:Remove passphrase' \
'migrate:Migrate existing filesystem to bcachefs' \
'migrate-superblock:Move superblock to standard location' \
'set-file-option:Set file-level options' \
'reflink-option-propagate:Propagate options to reflinked files' \
'dump:Dump filesystem metadata' \
'undump:Restore dumped metadata' \
'list:List filesystem metadata' \
'list_journal:List journal entries' \
'kill_btree_node:Remove a btree node' \
'data-read:Read data with extended error info' \
'unpoison:Clear poison flags on file extents' \
'completions:Generate shell completions' \
'version:Display version' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'bcachefs help commands' commands "$@"
}
(( $+functions[_bcachefs__help__completions_commands] )) ||
_bcachefs__help__completions_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help completions commands' commands "$@"
}
(( $+functions[_bcachefs__help__data-read_commands] )) ||
_bcachefs__help__data-read_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help data-read commands' commands "$@"
}
(( $+functions[_bcachefs__help__device_commands] )) ||
_bcachefs__help__device_commands() {
    local commands; commands=(
'add:Add a device to a filesystem' \
'online:Bring a device online' \
'offline:Take a device offline' \
'remove:Remove a device' \
'evacuate:Evacuate data from a device' \
'set-state:Set device state' \
'resize:Resize filesystem on a device' \
'resize-journal:Resize journal on a device' \
    )
    _describe -t commands 'bcachefs help device commands' commands "$@"
}
(( $+functions[_bcachefs__help__device__add_commands] )) ||
_bcachefs__help__device__add_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help device add commands' commands "$@"
}
(( $+functions[_bcachefs__help__device__evacuate_commands] )) ||
_bcachefs__help__device__evacuate_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help device evacuate commands' commands "$@"
}
(( $+functions[_bcachefs__help__device__offline_commands] )) ||
_bcachefs__help__device__offline_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help device offline commands' commands "$@"
}
(( $+functions[_bcachefs__help__device__online_commands] )) ||
_bcachefs__help__device__online_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help device online commands' commands "$@"
}
(( $+functions[_bcachefs__help__device__remove_commands] )) ||
_bcachefs__help__device__remove_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help device remove commands' commands "$@"
}
(( $+functions[_bcachefs__help__device__resize_commands] )) ||
_bcachefs__help__device__resize_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help device resize commands' commands "$@"
}
(( $+functions[_bcachefs__help__device__resize-journal_commands] )) ||
_bcachefs__help__device__resize-journal_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help device resize-journal commands' commands "$@"
}
(( $+functions[_bcachefs__help__device__set-state_commands] )) ||
_bcachefs__help__device__set-state_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help device set-state commands' commands "$@"
}
(( $+functions[_bcachefs__help__dump_commands] )) ||
_bcachefs__help__dump_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help dump commands' commands "$@"
}
(( $+functions[_bcachefs__help__format_commands] )) ||
_bcachefs__help__format_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help format commands' commands "$@"
}
(( $+functions[_bcachefs__help__fs_commands] )) ||
_bcachefs__help__fs_commands() {
    local commands; commands=(
'usage:Show filesystem disk usage' \
'top:Show live performance counters' \
'timestats:Show operation latency statistics' \
    )
    _describe -t commands 'bcachefs help fs commands' commands "$@"
}
(( $+functions[_bcachefs__help__fs__timestats_commands] )) ||
_bcachefs__help__fs__timestats_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help fs timestats commands' commands "$@"
}
(( $+functions[_bcachefs__help__fs__top_commands] )) ||
_bcachefs__help__fs__top_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help fs top commands' commands "$@"
}
(( $+functions[_bcachefs__help__fs__usage_commands] )) ||
_bcachefs__help__fs__usage_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help fs usage commands' commands "$@"
}
(( $+functions[_bcachefs__help__fsck_commands] )) ||
_bcachefs__help__fsck_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help fsck commands' commands "$@"
}
(( $+functions[_bcachefs__help__fusemount_commands] )) ||
_bcachefs__help__fusemount_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help fusemount commands' commands "$@"
}
(( $+functions[_bcachefs__help__help_commands] )) ||
_bcachefs__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help help commands' commands "$@"
}
(( $+functions[_bcachefs__help__image_commands] )) ||
_bcachefs__help__image_commands() {
    local commands; commands=(
'create:Create a filesystem image' \
'update:Update a filesystem image' \
    )
    _describe -t commands 'bcachefs help image commands' commands "$@"
}
(( $+functions[_bcachefs__help__image__create_commands] )) ||
_bcachefs__help__image__create_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help image create commands' commands "$@"
}
(( $+functions[_bcachefs__help__image__update_commands] )) ||
_bcachefs__help__image__update_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help image update commands' commands "$@"
}
(( $+functions[_bcachefs__help__kill_btree_node_commands] )) ||
_bcachefs__help__kill_btree_node_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help kill_btree_node commands' commands "$@"
}
(( $+functions[_bcachefs__help__list_commands] )) ||
_bcachefs__help__list_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help list commands' commands "$@"
}
(( $+functions[_bcachefs__help__list_journal_commands] )) ||
_bcachefs__help__list_journal_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help list_journal commands' commands "$@"
}
(( $+functions[_bcachefs__help__migrate_commands] )) ||
_bcachefs__help__migrate_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help migrate commands' commands "$@"
}
(( $+functions[_bcachefs__help__migrate-superblock_commands] )) ||
_bcachefs__help__migrate-superblock_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help migrate-superblock commands' commands "$@"
}
(( $+functions[_bcachefs__help__mount_commands] )) ||
_bcachefs__help__mount_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help mount commands' commands "$@"
}
(( $+functions[_bcachefs__help__reconcile_commands] )) ||
_bcachefs__help__reconcile_commands() {
    local commands; commands=(
'status:Show reconcile status' \
'wait:Wait for reconcile to complete' \
    )
    _describe -t commands 'bcachefs help reconcile commands' commands "$@"
}
(( $+functions[_bcachefs__help__reconcile__status_commands] )) ||
_bcachefs__help__reconcile__status_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help reconcile status commands' commands "$@"
}
(( $+functions[_bcachefs__help__reconcile__wait_commands] )) ||
_bcachefs__help__reconcile__wait_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help reconcile wait commands' commands "$@"
}
(( $+functions[_bcachefs__help__recover-super_commands] )) ||
_bcachefs__help__recover-super_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help recover-super commands' commands "$@"
}
(( $+functions[_bcachefs__help__recovery-pass_commands] )) ||
_bcachefs__help__recovery-pass_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help recovery-pass commands' commands "$@"
}
(( $+functions[_bcachefs__help__reflink-option-propagate_commands] )) ||
_bcachefs__help__reflink-option-propagate_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help reflink-option-propagate commands' commands "$@"
}
(( $+functions[_bcachefs__help__remove-passphrase_commands] )) ||
_bcachefs__help__remove-passphrase_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help remove-passphrase commands' commands "$@"
}
(( $+functions[_bcachefs__help__reset-counters_commands] )) ||
_bcachefs__help__reset-counters_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help reset-counters commands' commands "$@"
}
(( $+functions[_bcachefs__help__scrub_commands] )) ||
_bcachefs__help__scrub_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help scrub commands' commands "$@"
}
(( $+functions[_bcachefs__help__set-file-option_commands] )) ||
_bcachefs__help__set-file-option_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help set-file-option commands' commands "$@"
}
(( $+functions[_bcachefs__help__set-fs-option_commands] )) ||
_bcachefs__help__set-fs-option_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help set-fs-option commands' commands "$@"
}
(( $+functions[_bcachefs__help__set-passphrase_commands] )) ||
_bcachefs__help__set-passphrase_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help set-passphrase commands' commands "$@"
}
(( $+functions[_bcachefs__help__show-super_commands] )) ||
_bcachefs__help__show-super_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help show-super commands' commands "$@"
}
(( $+functions[_bcachefs__help__strip-alloc_commands] )) ||
_bcachefs__help__strip-alloc_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help strip-alloc commands' commands "$@"
}
(( $+functions[_bcachefs__help__subvolume_commands] )) ||
_bcachefs__help__subvolume_commands() {
    local commands; commands=(
'create:Create a new subvolume' \
'delete:Delete an existing subvolume' \
'snapshot:Create a snapshot of a subvolume' \
'list:List subvolumes' \
'list-snapshots:List snapshots and their disk usage' \
    )
    _describe -t commands 'bcachefs help subvolume commands' commands "$@"
}
(( $+functions[_bcachefs__help__subvolume__create_commands] )) ||
_bcachefs__help__subvolume__create_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help subvolume create commands' commands "$@"
}
(( $+functions[_bcachefs__help__subvolume__delete_commands] )) ||
_bcachefs__help__subvolume__delete_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help subvolume delete commands' commands "$@"
}
(( $+functions[_bcachefs__help__subvolume__list_commands] )) ||
_bcachefs__help__subvolume__list_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help subvolume list commands' commands "$@"
}
(( $+functions[_bcachefs__help__subvolume__list-snapshots_commands] )) ||
_bcachefs__help__subvolume__list-snapshots_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help subvolume list-snapshots commands' commands "$@"
}
(( $+functions[_bcachefs__help__subvolume__snapshot_commands] )) ||
_bcachefs__help__subvolume__snapshot_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help subvolume snapshot commands' commands "$@"
}
(( $+functions[_bcachefs__help__undump_commands] )) ||
_bcachefs__help__undump_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help undump commands' commands "$@"
}
(( $+functions[_bcachefs__help__unlock_commands] )) ||
_bcachefs__help__unlock_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help unlock commands' commands "$@"
}
(( $+functions[_bcachefs__help__unpoison_commands] )) ||
_bcachefs__help__unpoison_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help unpoison commands' commands "$@"
}
(( $+functions[_bcachefs__help__version_commands] )) ||
_bcachefs__help__version_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs help version commands' commands "$@"
}
(( $+functions[_bcachefs__image_commands] )) ||
_bcachefs__image_commands() {
    local commands; commands=(
'create:Create a filesystem image' \
'update:Update a filesystem image' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'bcachefs image commands' commands "$@"
}
(( $+functions[_bcachefs__image__create_commands] )) ||
_bcachefs__image__create_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs image create commands' commands "$@"
}
(( $+functions[_bcachefs__image__help_commands] )) ||
_bcachefs__image__help_commands() {
    local commands; commands=(
'create:Create a filesystem image' \
'update:Update a filesystem image' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'bcachefs image help commands' commands "$@"
}
(( $+functions[_bcachefs__image__help__create_commands] )) ||
_bcachefs__image__help__create_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs image help create commands' commands "$@"
}
(( $+functions[_bcachefs__image__help__help_commands] )) ||
_bcachefs__image__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs image help help commands' commands "$@"
}
(( $+functions[_bcachefs__image__help__update_commands] )) ||
_bcachefs__image__help__update_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs image help update commands' commands "$@"
}
(( $+functions[_bcachefs__image__update_commands] )) ||
_bcachefs__image__update_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs image update commands' commands "$@"
}
(( $+functions[_bcachefs__kill_btree_node_commands] )) ||
_bcachefs__kill_btree_node_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs kill_btree_node commands' commands "$@"
}
(( $+functions[_bcachefs__list_commands] )) ||
_bcachefs__list_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs list commands' commands "$@"
}
(( $+functions[_bcachefs__list_journal_commands] )) ||
_bcachefs__list_journal_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs list_journal commands' commands "$@"
}
(( $+functions[_bcachefs__migrate_commands] )) ||
_bcachefs__migrate_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs migrate commands' commands "$@"
}
(( $+functions[_bcachefs__migrate-superblock_commands] )) ||
_bcachefs__migrate-superblock_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs migrate-superblock commands' commands "$@"
}
(( $+functions[_bcachefs__mount_commands] )) ||
_bcachefs__mount_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs mount commands' commands "$@"
}
(( $+functions[_bcachefs__reconcile_commands] )) ||
_bcachefs__reconcile_commands() {
    local commands; commands=(
'status:Show reconcile status' \
'wait:Wait for reconcile to complete' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'bcachefs reconcile commands' commands "$@"
}
(( $+functions[_bcachefs__reconcile__help_commands] )) ||
_bcachefs__reconcile__help_commands() {
    local commands; commands=(
'status:Show reconcile status' \
'wait:Wait for reconcile to complete' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'bcachefs reconcile help commands' commands "$@"
}
(( $+functions[_bcachefs__reconcile__help__help_commands] )) ||
_bcachefs__reconcile__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs reconcile help help commands' commands "$@"
}
(( $+functions[_bcachefs__reconcile__help__status_commands] )) ||
_bcachefs__reconcile__help__status_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs reconcile help status commands' commands "$@"
}
(( $+functions[_bcachefs__reconcile__help__wait_commands] )) ||
_bcachefs__reconcile__help__wait_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs reconcile help wait commands' commands "$@"
}
(( $+functions[_bcachefs__reconcile__status_commands] )) ||
_bcachefs__reconcile__status_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs reconcile status commands' commands "$@"
}
(( $+functions[_bcachefs__reconcile__wait_commands] )) ||
_bcachefs__reconcile__wait_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs reconcile wait commands' commands "$@"
}
(( $+functions[_bcachefs__recover-super_commands] )) ||
_bcachefs__recover-super_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs recover-super commands' commands "$@"
}
(( $+functions[_bcachefs__recovery-pass_commands] )) ||
_bcachefs__recovery-pass_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs recovery-pass commands' commands "$@"
}
(( $+functions[_bcachefs__reflink-option-propagate_commands] )) ||
_bcachefs__reflink-option-propagate_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs reflink-option-propagate commands' commands "$@"
}
(( $+functions[_bcachefs__remove-passphrase_commands] )) ||
_bcachefs__remove-passphrase_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs remove-passphrase commands' commands "$@"
}
(( $+functions[_bcachefs__reset-counters_commands] )) ||
_bcachefs__reset-counters_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs reset-counters commands' commands "$@"
}
(( $+functions[_bcachefs__scrub_commands] )) ||
_bcachefs__scrub_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs scrub commands' commands "$@"
}
(( $+functions[_bcachefs__set-file-option_commands] )) ||
_bcachefs__set-file-option_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs set-file-option commands' commands "$@"
}
(( $+functions[_bcachefs__set-fs-option_commands] )) ||
_bcachefs__set-fs-option_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs set-fs-option commands' commands "$@"
}
(( $+functions[_bcachefs__set-passphrase_commands] )) ||
_bcachefs__set-passphrase_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs set-passphrase commands' commands "$@"
}
(( $+functions[_bcachefs__show-super_commands] )) ||
_bcachefs__show-super_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs show-super commands' commands "$@"
}
(( $+functions[_bcachefs__strip-alloc_commands] )) ||
_bcachefs__strip-alloc_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs strip-alloc commands' commands "$@"
}
(( $+functions[_bcachefs__subvolume_commands] )) ||
_bcachefs__subvolume_commands() {
    local commands; commands=(
'create:Create a new subvolume' \
'new:Create a new subvolume' \
'delete:Delete an existing subvolume' \
'del:Delete an existing subvolume' \
'snapshot:Create a snapshot of a subvolume' \
'snap:Create a snapshot of a subvolume' \
'list:List subvolumes' \
'ls:List subvolumes' \
'list-snapshots:List snapshots and their disk usage' \
'ls-snap:List snapshots and their disk usage' \
'list-snap:List snapshots and their disk usage' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'bcachefs subvolume commands' commands "$@"
}
(( $+functions[_bcachefs__subvolume__create_commands] )) ||
_bcachefs__subvolume__create_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs subvolume create commands' commands "$@"
}
(( $+functions[_bcachefs__subvolume__delete_commands] )) ||
_bcachefs__subvolume__delete_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs subvolume delete commands' commands "$@"
}
(( $+functions[_bcachefs__subvolume__help_commands] )) ||
_bcachefs__subvolume__help_commands() {
    local commands; commands=(
'create:Create a new subvolume' \
'delete:Delete an existing subvolume' \
'snapshot:Create a snapshot of a subvolume' \
'list:List subvolumes' \
'list-snapshots:List snapshots and their disk usage' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'bcachefs subvolume help commands' commands "$@"
}
(( $+functions[_bcachefs__subvolume__help__create_commands] )) ||
_bcachefs__subvolume__help__create_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs subvolume help create commands' commands "$@"
}
(( $+functions[_bcachefs__subvolume__help__delete_commands] )) ||
_bcachefs__subvolume__help__delete_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs subvolume help delete commands' commands "$@"
}
(( $+functions[_bcachefs__subvolume__help__help_commands] )) ||
_bcachefs__subvolume__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs subvolume help help commands' commands "$@"
}
(( $+functions[_bcachefs__subvolume__help__list_commands] )) ||
_bcachefs__subvolume__help__list_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs subvolume help list commands' commands "$@"
}
(( $+functions[_bcachefs__subvolume__help__list-snapshots_commands] )) ||
_bcachefs__subvolume__help__list-snapshots_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs subvolume help list-snapshots commands' commands "$@"
}
(( $+functions[_bcachefs__subvolume__help__snapshot_commands] )) ||
_bcachefs__subvolume__help__snapshot_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs subvolume help snapshot commands' commands "$@"
}
(( $+functions[_bcachefs__subvolume__list_commands] )) ||
_bcachefs__subvolume__list_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs subvolume list commands' commands "$@"
}
(( $+functions[_bcachefs__subvolume__list-snapshots_commands] )) ||
_bcachefs__subvolume__list-snapshots_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs subvolume list-snapshots commands' commands "$@"
}
(( $+functions[_bcachefs__subvolume__snapshot_commands] )) ||
_bcachefs__subvolume__snapshot_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs subvolume snapshot commands' commands "$@"
}
(( $+functions[_bcachefs__undump_commands] )) ||
_bcachefs__undump_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs undump commands' commands "$@"
}
(( $+functions[_bcachefs__unlock_commands] )) ||
_bcachefs__unlock_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs unlock commands' commands "$@"
}
(( $+functions[_bcachefs__unpoison_commands] )) ||
_bcachefs__unpoison_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs unpoison commands' commands "$@"
}
(( $+functions[_bcachefs__version_commands] )) ||
_bcachefs__version_commands() {
    local commands; commands=()
    _describe -t commands 'bcachefs version commands' commands "$@"
}

if [ "$funcstack[1]" = "_bcachefs" ]; then
    _bcachefs "$@"
else
    compdef _bcachefs bcachefs
fi
