_bcachefs() {
    local i cur prev opts cmd
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"
    cmd=""
    opts=""

    for i in ${COMP_WORDS[@]}
    do
        case "${cmd},${i}" in
            ",$1")
                cmd="bcachefs"
                ;;
            bcachefs,completions)
                cmd="bcachefs__completions"
                ;;
            bcachefs,data)
                cmd="bcachefs__data"
                ;;
            bcachefs,device)
                cmd="bcachefs__device"
                ;;
            bcachefs,dump)
                cmd="bcachefs__dump"
                ;;
            bcachefs,format)
                cmd="bcachefs__format"
                ;;
            bcachefs,fs)
                cmd="bcachefs__fs"
                ;;
            bcachefs,fsck)
                cmd="bcachefs__fsck"
                ;;
            bcachefs,help)
                cmd="bcachefs__help"
                ;;
            bcachefs,image)
                cmd="bcachefs__image"
                ;;
            bcachefs,kill_btree_node)
                cmd="bcachefs__kill_btree_node"
                ;;
            bcachefs,list)
                cmd="bcachefs__list"
                ;;
            bcachefs,list_journal)
                cmd="bcachefs__list_journal"
                ;;
            bcachefs,migrate)
                cmd="bcachefs__migrate"
                ;;
            bcachefs,migrate-superblock)
                cmd="bcachefs__migrate__superblock"
                ;;
            bcachefs,mkfs)
                cmd="bcachefs__format"
                ;;
            bcachefs,mount)
                cmd="bcachefs__mount"
                ;;
            bcachefs,reconcile)
                cmd="bcachefs__reconcile"
                ;;
            bcachefs,recover-super)
                cmd="bcachefs__recover__super"
                ;;
            bcachefs,recovery-pass)
                cmd="bcachefs__recovery__pass"
                ;;
            bcachefs,reflink-option-propagate)
                cmd="bcachefs__reflink__option__propagate"
                ;;
            bcachefs,remove-passphrase)
                cmd="bcachefs__remove__passphrase"
                ;;
            bcachefs,reset-counters)
                cmd="bcachefs__reset__counters"
                ;;
            bcachefs,scrub)
                cmd="bcachefs__scrub"
                ;;
            bcachefs,set-file-option)
                cmd="bcachefs__set__file__option"
                ;;
            bcachefs,set-fs-option)
                cmd="bcachefs__set__fs__option"
                ;;
            bcachefs,set-passphrase)
                cmd="bcachefs__set__passphrase"
                ;;
            bcachefs,show-super)
                cmd="bcachefs__show__super"
                ;;
            bcachefs,strip-alloc)
                cmd="bcachefs__strip__alloc"
                ;;
            bcachefs,subvol)
                cmd="bcachefs__subvolume"
                ;;
            bcachefs,subvolume)
                cmd="bcachefs__subvolume"
                ;;
            bcachefs,undump)
                cmd="bcachefs__undump"
                ;;
            bcachefs,unlock)
                cmd="bcachefs__unlock"
                ;;
            bcachefs,version)
                cmd="bcachefs__version"
                ;;
            bcachefs__data,help)
                cmd="bcachefs__data__help"
                ;;
            bcachefs__data,scrub)
                cmd="bcachefs__data__scrub"
                ;;
            bcachefs__data__help,help)
                cmd="bcachefs__data__help__help"
                ;;
            bcachefs__data__help,scrub)
                cmd="bcachefs__data__help__scrub"
                ;;
            bcachefs__device,add)
                cmd="bcachefs__device__add"
                ;;
            bcachefs__device,evacuate)
                cmd="bcachefs__device__evacuate"
                ;;
            bcachefs__device,help)
                cmd="bcachefs__device__help"
                ;;
            bcachefs__device,offline)
                cmd="bcachefs__device__offline"
                ;;
            bcachefs__device,online)
                cmd="bcachefs__device__online"
                ;;
            bcachefs__device,remove)
                cmd="bcachefs__device__remove"
                ;;
            bcachefs__device,resize)
                cmd="bcachefs__device__resize"
                ;;
            bcachefs__device,resize-journal)
                cmd="bcachefs__device__resize__journal"
                ;;
            bcachefs__device,set-state)
                cmd="bcachefs__device__set__state"
                ;;
            bcachefs__device__help,add)
                cmd="bcachefs__device__help__add"
                ;;
            bcachefs__device__help,evacuate)
                cmd="bcachefs__device__help__evacuate"
                ;;
            bcachefs__device__help,help)
                cmd="bcachefs__device__help__help"
                ;;
            bcachefs__device__help,offline)
                cmd="bcachefs__device__help__offline"
                ;;
            bcachefs__device__help,online)
                cmd="bcachefs__device__help__online"
                ;;
            bcachefs__device__help,remove)
                cmd="bcachefs__device__help__remove"
                ;;
            bcachefs__device__help,resize)
                cmd="bcachefs__device__help__resize"
                ;;
            bcachefs__device__help,resize-journal)
                cmd="bcachefs__device__help__resize__journal"
                ;;
            bcachefs__device__help,set-state)
                cmd="bcachefs__device__help__set__state"
                ;;
            bcachefs__fs,help)
                cmd="bcachefs__fs__help"
                ;;
            bcachefs__fs,timestats)
                cmd="bcachefs__fs__timestats"
                ;;
            bcachefs__fs,top)
                cmd="bcachefs__fs__top"
                ;;
            bcachefs__fs,usage)
                cmd="bcachefs__fs__usage"
                ;;
            bcachefs__fs__help,help)
                cmd="bcachefs__fs__help__help"
                ;;
            bcachefs__fs__help,timestats)
                cmd="bcachefs__fs__help__timestats"
                ;;
            bcachefs__fs__help,top)
                cmd="bcachefs__fs__help__top"
                ;;
            bcachefs__fs__help,usage)
                cmd="bcachefs__fs__help__usage"
                ;;
            bcachefs__help,completions)
                cmd="bcachefs__help__completions"
                ;;
            bcachefs__help,data)
                cmd="bcachefs__help__data"
                ;;
            bcachefs__help,device)
                cmd="bcachefs__help__device"
                ;;
            bcachefs__help,dump)
                cmd="bcachefs__help__dump"
                ;;
            bcachefs__help,format)
                cmd="bcachefs__help__format"
                ;;
            bcachefs__help,fs)
                cmd="bcachefs__help__fs"
                ;;
            bcachefs__help,fsck)
                cmd="bcachefs__help__fsck"
                ;;
            bcachefs__help,help)
                cmd="bcachefs__help__help"
                ;;
            bcachefs__help,image)
                cmd="bcachefs__help__image"
                ;;
            bcachefs__help,kill_btree_node)
                cmd="bcachefs__help__kill_btree_node"
                ;;
            bcachefs__help,list)
                cmd="bcachefs__help__list"
                ;;
            bcachefs__help,list_journal)
                cmd="bcachefs__help__list_journal"
                ;;
            bcachefs__help,migrate)
                cmd="bcachefs__help__migrate"
                ;;
            bcachefs__help,migrate-superblock)
                cmd="bcachefs__help__migrate__superblock"
                ;;
            bcachefs__help,mount)
                cmd="bcachefs__help__mount"
                ;;
            bcachefs__help,reconcile)
                cmd="bcachefs__help__reconcile"
                ;;
            bcachefs__help,recover-super)
                cmd="bcachefs__help__recover__super"
                ;;
            bcachefs__help,recovery-pass)
                cmd="bcachefs__help__recovery__pass"
                ;;
            bcachefs__help,reflink-option-propagate)
                cmd="bcachefs__help__reflink__option__propagate"
                ;;
            bcachefs__help,remove-passphrase)
                cmd="bcachefs__help__remove__passphrase"
                ;;
            bcachefs__help,reset-counters)
                cmd="bcachefs__help__reset__counters"
                ;;
            bcachefs__help,scrub)
                cmd="bcachefs__help__scrub"
                ;;
            bcachefs__help,set-file-option)
                cmd="bcachefs__help__set__file__option"
                ;;
            bcachefs__help,set-fs-option)
                cmd="bcachefs__help__set__fs__option"
                ;;
            bcachefs__help,set-passphrase)
                cmd="bcachefs__help__set__passphrase"
                ;;
            bcachefs__help,show-super)
                cmd="bcachefs__help__show__super"
                ;;
            bcachefs__help,strip-alloc)
                cmd="bcachefs__help__strip__alloc"
                ;;
            bcachefs__help,subvolume)
                cmd="bcachefs__help__subvolume"
                ;;
            bcachefs__help,undump)
                cmd="bcachefs__help__undump"
                ;;
            bcachefs__help,unlock)
                cmd="bcachefs__help__unlock"
                ;;
            bcachefs__help,version)
                cmd="bcachefs__help__version"
                ;;
            bcachefs__help__data,scrub)
                cmd="bcachefs__help__data__scrub"
                ;;
            bcachefs__help__device,add)
                cmd="bcachefs__help__device__add"
                ;;
            bcachefs__help__device,evacuate)
                cmd="bcachefs__help__device__evacuate"
                ;;
            bcachefs__help__device,offline)
                cmd="bcachefs__help__device__offline"
                ;;
            bcachefs__help__device,online)
                cmd="bcachefs__help__device__online"
                ;;
            bcachefs__help__device,remove)
                cmd="bcachefs__help__device__remove"
                ;;
            bcachefs__help__device,resize)
                cmd="bcachefs__help__device__resize"
                ;;
            bcachefs__help__device,resize-journal)
                cmd="bcachefs__help__device__resize__journal"
                ;;
            bcachefs__help__device,set-state)
                cmd="bcachefs__help__device__set__state"
                ;;
            bcachefs__help__fs,timestats)
                cmd="bcachefs__help__fs__timestats"
                ;;
            bcachefs__help__fs,top)
                cmd="bcachefs__help__fs__top"
                ;;
            bcachefs__help__fs,usage)
                cmd="bcachefs__help__fs__usage"
                ;;
            bcachefs__help__image,create)
                cmd="bcachefs__help__image__create"
                ;;
            bcachefs__help__image,update)
                cmd="bcachefs__help__image__update"
                ;;
            bcachefs__help__reconcile,status)
                cmd="bcachefs__help__reconcile__status"
                ;;
            bcachefs__help__reconcile,wait)
                cmd="bcachefs__help__reconcile__wait"
                ;;
            bcachefs__help__subvolume,create)
                cmd="bcachefs__help__subvolume__create"
                ;;
            bcachefs__help__subvolume,delete)
                cmd="bcachefs__help__subvolume__delete"
                ;;
            bcachefs__help__subvolume,list)
                cmd="bcachefs__help__subvolume__list"
                ;;
            bcachefs__help__subvolume,list-snapshots)
                cmd="bcachefs__help__subvolume__list__snapshots"
                ;;
            bcachefs__help__subvolume,snapshot)
                cmd="bcachefs__help__subvolume__snapshot"
                ;;
            bcachefs__image,create)
                cmd="bcachefs__image__create"
                ;;
            bcachefs__image,help)
                cmd="bcachefs__image__help"
                ;;
            bcachefs__image,update)
                cmd="bcachefs__image__update"
                ;;
            bcachefs__image__help,create)
                cmd="bcachefs__image__help__create"
                ;;
            bcachefs__image__help,help)
                cmd="bcachefs__image__help__help"
                ;;
            bcachefs__image__help,update)
                cmd="bcachefs__image__help__update"
                ;;
            bcachefs__reconcile,help)
                cmd="bcachefs__reconcile__help"
                ;;
            bcachefs__reconcile,status)
                cmd="bcachefs__reconcile__status"
                ;;
            bcachefs__reconcile,wait)
                cmd="bcachefs__reconcile__wait"
                ;;
            bcachefs__reconcile__help,help)
                cmd="bcachefs__reconcile__help__help"
                ;;
            bcachefs__reconcile__help,status)
                cmd="bcachefs__reconcile__help__status"
                ;;
            bcachefs__reconcile__help,wait)
                cmd="bcachefs__reconcile__help__wait"
                ;;
            bcachefs__subvolume,create)
                cmd="bcachefs__subvolume__create"
                ;;
            bcachefs__subvolume,del)
                cmd="bcachefs__subvolume__delete"
                ;;
            bcachefs__subvolume,delete)
                cmd="bcachefs__subvolume__delete"
                ;;
            bcachefs__subvolume,help)
                cmd="bcachefs__subvolume__help"
                ;;
            bcachefs__subvolume,list)
                cmd="bcachefs__subvolume__list"
                ;;
            bcachefs__subvolume,list-snap)
                cmd="bcachefs__subvolume__list__snapshots"
                ;;
            bcachefs__subvolume,list-snapshots)
                cmd="bcachefs__subvolume__list__snapshots"
                ;;
            bcachefs__subvolume,ls)
                cmd="bcachefs__subvolume__list"
                ;;
            bcachefs__subvolume,ls-snap)
                cmd="bcachefs__subvolume__list__snapshots"
                ;;
            bcachefs__subvolume,new)
                cmd="bcachefs__subvolume__create"
                ;;
            bcachefs__subvolume,snap)
                cmd="bcachefs__subvolume__snapshot"
                ;;
            bcachefs__subvolume,snapshot)
                cmd="bcachefs__subvolume__snapshot"
                ;;
            bcachefs__subvolume__help,create)
                cmd="bcachefs__subvolume__help__create"
                ;;
            bcachefs__subvolume__help,delete)
                cmd="bcachefs__subvolume__help__delete"
                ;;
            bcachefs__subvolume__help,help)
                cmd="bcachefs__subvolume__help__help"
                ;;
            bcachefs__subvolume__help,list)
                cmd="bcachefs__subvolume__help__list"
                ;;
            bcachefs__subvolume__help,list-snapshots)
                cmd="bcachefs__subvolume__help__list__snapshots"
                ;;
            bcachefs__subvolume__help,snapshot)
                cmd="bcachefs__subvolume__help__snapshot"
                ;;
            *)
                ;;
        esac
    done

    case "${cmd}" in
        bcachefs)
            opts="-h --help list mount completions subvolume subvol set-file-option reflink-option-propagate reset-counters version data device dump format mkfs fs fsck image kill_btree_node list_journal migrate migrate-superblock reconcile recover-super recovery-pass scrub set-fs-option set-passphrase remove-passphrase show-super unlock strip-alloc undump help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__completions)
            opts="-h --help bash elvish fish powershell zsh"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__data)
            opts="-h --help scrub help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__data__help)
            opts="scrub help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__data__help__help)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__data__help__scrub)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__data__scrub)
            opts="-m -h --metadata --help <FILESYSTEM>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__device)
            opts="-h --help add online offline remove evacuate set-state resize resize-journal help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__device__add)
            opts="-l -f -h --block-size --block_size --btree-node-size --btree_node_size --errors --write-error-timeout --write_error_timeout --metadata-replicas --metadata_replicas --data-replicas --data_replicas --encoded-extent-max --encoded_extent_max --metadata-checksum --metadata_checksum --data-checksum --data_checksum --checksum-err-retry-nr --checksum_err_retry_nr --compression --background-compression --background_compression --str-hash --str_hash --metadata-target --metadata_target --foreground-target --foreground_target --background-target --background_target --promote-target --promote_target --erasure-code --erasure_code --casefold --inodes-32bit --inodes_32bit --shard-inode-numbers-bits --shard_inode_numbers_bits --gc-reserve-percent --gc_reserve_percent --gc-reserve-bytes --gc_reserve_bytes --root-reserve-percent --root_reserve_percent --wide-macs --wide_macs --acl --usrquota --grpquota --prjquota --journal-transaction-names --journal_transaction_names --allocator-stuck-timeout --allocator_stuck_timeout --nocow --state --bucket-size --bucket_size --durability --data-allowed --data_allowed --discard --rotational --label --force --help <filesystem> <device>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --block_size)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --block-size)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --btree_node_size)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --btree-node-size)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --errors)
                    COMPREPLY=($(compgen -W "continue fix_safe panic ro" -- "${cur}"))
                    return 0
                    ;;
                --write_error_timeout)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --write-error-timeout)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --metadata_replicas)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --metadata-replicas)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --data_replicas)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --data-replicas)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --encoded_extent_max)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --encoded-extent-max)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --metadata_checksum)
                    COMPREPLY=($(compgen -W "none crc32c crc64 xxhash" -- "${cur}"))
                    return 0
                    ;;
                --metadata-checksum)
                    COMPREPLY=($(compgen -W "none crc32c crc64 xxhash" -- "${cur}"))
                    return 0
                    ;;
                --data_checksum)
                    COMPREPLY=($(compgen -W "none crc32c crc64 xxhash" -- "${cur}"))
                    return 0
                    ;;
                --data-checksum)
                    COMPREPLY=($(compgen -W "none crc32c crc64 xxhash" -- "${cur}"))
                    return 0
                    ;;
                --checksum_err_retry_nr)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --checksum-err-retry-nr)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --compression)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --background_compression)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --background-compression)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --str_hash)
                    COMPREPLY=($(compgen -W "crc32c crc64 siphash" -- "${cur}"))
                    return 0
                    ;;
                --str-hash)
                    COMPREPLY=($(compgen -W "crc32c crc64 siphash" -- "${cur}"))
                    return 0
                    ;;
                --metadata_target)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --metadata-target)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --foreground_target)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --foreground-target)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --background_target)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --background-target)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --promote_target)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --promote-target)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --erasure_code)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --erasure-code)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --casefold)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --inodes_32bit)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --inodes-32bit)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --shard_inode_numbers_bits)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --shard-inode-numbers-bits)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --gc_reserve_percent)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --gc-reserve-percent)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --gc_reserve_bytes)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --gc-reserve-bytes)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --root_reserve_percent)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --root-reserve-percent)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --wide_macs)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --wide-macs)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --acl)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --usrquota)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --grpquota)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --prjquota)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --journal_transaction_names)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --journal-transaction-names)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --allocator_stuck_timeout)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --allocator-stuck-timeout)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --nocow)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --state)
                    COMPREPLY=($(compgen -W "rw ro evacuating spare" -- "${cur}"))
                    return 0
                    ;;
                --bucket_size)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --bucket-size)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --durability)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --data_allowed)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --data-allowed)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --discard)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --rotational)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --label)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -l)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__device__evacuate)
            opts="-h --help <DEVICE>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__device__help)
            opts="add online offline remove evacuate set-state resize resize-journal help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__device__help__add)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__device__help__evacuate)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__device__help__help)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__device__help__offline)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__device__help__online)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__device__help__remove)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__device__help__resize)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__device__help__resize__journal)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__device__help__set__state)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__device__offline)
            opts="-f -h --force --help <DEVICE>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__device__online)
            opts="-h --help <DEVICE>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__device__remove)
            opts="-f -F -h --force --force-metadata --help <DEVICE> [PATH]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__device__resize)
            opts="-h --help <DEVICE> [SIZE]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__device__resize__journal)
            opts="-h --help <DEVICE> <SIZE>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__device__set__state)
            opts="-f -F -o -h --force --force-if-data-lost --offline --help rw ro evacuating spare <DEVICE> [PATH]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__dump)
            opts="-o -f -s -v -h --force --sanitize --nojournal --noexcl --verbose --help <DEVICES>..."
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                -o)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --sanitize)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -s)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__format)
            opts="-h --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__format)
            opts="-h --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__fs)
            opts="-h --help usage top timestats help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__fs__help)
            opts="usage top timestats help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__fs__help__help)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__fs__help__timestats)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__fs__help__top)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__fs__help__usage)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__fs__timestats)
            opts="-a -s -i -h --all --sort --json --no-device-stats --once --interval --help [FILESYSTEM]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --sort)
                    COMPREPLY=($(compgen -W "name count dur-min dur-max dur-total mean-since mean-recent stddev-since stddev-recent" -- "${cur}"))
                    return 0
                    ;;
                -s)
                    COMPREPLY=($(compgen -W "name count dur-min dur-max dur-total mean-since mean-recent stddev-since stddev-recent" -- "${cur}"))
                    return 0
                    ;;
                --interval)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -i)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__fs__top)
            opts="-h --help --human-readable [FILESYSTEM]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__fs__usage)
            opts="-f -a -h --help --fields --all --human-readable [MOUNTPOINTS]..."
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --fields)
                    COMPREPLY=($(compgen -W "replicas btree compression rebalance_work devices" -- "${cur}"))
                    return 0
                    ;;
                -f)
                    COMPREPLY=($(compgen -W "replicas btree compression rebalance_work devices" -- "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__fsck)
            opts="-p -n -y -f -o -r -k -K -v -h --ratelimit_errors --kernel --no-kernel --help <DEVICES>..."
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                -o)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help)
            opts="list mount completions subvolume set-file-option reflink-option-propagate reset-counters version data device dump format fs fsck image kill_btree_node list_journal migrate migrate-superblock reconcile recover-super recovery-pass scrub set-fs-option set-passphrase remove-passphrase show-super unlock strip-alloc undump help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__completions)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__data)
            opts="scrub"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__data__scrub)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__device)
            opts="add online offline remove evacuate set-state resize resize-journal"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__device__add)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__device__evacuate)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__device__offline)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__device__online)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__device__remove)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__device__resize)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__device__resize__journal)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__device__set__state)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__dump)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__format)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__fs)
            opts="usage top timestats"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__fs__timestats)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__fs__top)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__fs__usage)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__fsck)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__help)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__image)
            opts="create update"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__image__create)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__image__update)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__kill_btree_node)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__list)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__list_journal)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__migrate)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__migrate__superblock)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__mount)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__reconcile)
            opts="status wait"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__reconcile__status)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__reconcile__wait)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__recover__super)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__recovery__pass)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__reflink__option__propagate)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__remove__passphrase)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__reset__counters)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__scrub)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__set__file__option)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__set__fs__option)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__set__passphrase)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__show__super)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__strip__alloc)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__subvolume)
            opts="create delete snapshot list list-snapshots"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__subvolume__create)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__subvolume__delete)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__subvolume__list)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__subvolume__list__snapshots)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__subvolume__snapshot)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__undump)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__unlock)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__help__version)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__image)
            opts="-h --help create update help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__image__create)
            opts="-h --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__image__help)
            opts="create update help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__image__help__create)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__image__help__help)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__image__help__update)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__image__update)
            opts="-s -a -q -v -h --source --keep-alloc --quiet --verbose --help <IMAGE>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --source)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -s)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__kill_btree_node)
            opts="-n -d -h --node --dev --help <DEVICES>..."
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --node)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -n)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --dev)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -d)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__list)
            opts="-m -b -k -l -s -e -f -c -v -h --mode --btree --bkey-type --level --start --end --fsck --colorize --verbose --help <DEVICES>..."
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --mode)
                    COMPREPLY=($(compgen -W "keys formats nodes nodes-ondisk" -- "${cur}"))
                    return 0
                    ;;
                -m)
                    COMPREPLY=($(compgen -W "keys formats nodes nodes-ondisk" -- "${cur}"))
                    return 0
                    ;;
                --btree)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -b)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --bkey-type)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -k)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --level)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -l)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --start)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -s)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --end)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -e)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --colorize)
                    COMPREPLY=($(compgen -W "true false" -- "${cur}"))
                    return 0
                    ;;
                -c)
                    COMPREPLY=($(compgen -W "true false" -- "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__list_journal)
            opts="-a -d -n -s -B -F -D -H -l -L -o -b -t -k -V -v -h --all --dirty-only --nr-entries --seq --blacklisted --flush-only --datetime --headers-only --all-headers --log --log-only --offset --btree --transaction --key --bkey-val --verbose --help <DEVICES>..."
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --nr-entries)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -n)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --seq)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -s)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --btree)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -b)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --transaction)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -t)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --key)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -k)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --bkey-val)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -V)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__migrate)
            opts="-h --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__migrate__superblock)
            opts="-d -o -h --dev --offset --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --dev)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -d)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --offset)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -o)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__mount)
            opts="-f -k -o -t -c -v -h -V --passphrase-file --key_location --type --colorize --verbose --help --version <DEV> [MOUNTPOINT]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --passphrase-file)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -f)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --key_location)
                    COMPREPLY=($(compgen -W "fail wait ask stdin" -- "${cur}"))
                    return 0
                    ;;
                -k)
                    COMPREPLY=($(compgen -W "fail wait ask stdin" -- "${cur}"))
                    return 0
                    ;;
                -o)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --type)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -t)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --colorize)
                    COMPREPLY=($(compgen -W "true false" -- "${cur}"))
                    return 0
                    ;;
                -c)
                    COMPREPLY=($(compgen -W "true false" -- "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__reconcile)
            opts="-h --help status wait help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__reconcile__help)
            opts="status wait help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__reconcile__help__help)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__reconcile__help__status)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__reconcile__help__wait)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__reconcile__status)
            opts="-t --help --types [FILESYSTEM]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --types)
                    COMPREPLY=($(compgen -W "replicas checksum erasure_code compression target high_priority pending stripes" -- "${cur}"))
                    return 0
                    ;;
                -t)
                    COMPREPLY=($(compgen -W "replicas checksum erasure_code compression target high_priority pending stripes" -- "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__reconcile__wait)
            opts="-t --help --types [FILESYSTEM]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --types)
                    COMPREPLY=($(compgen -W "replicas checksum erasure_code compression target high_priority pending stripes" -- "${cur}"))
                    return 0
                    ;;
                -t)
                    COMPREPLY=($(compgen -W "replicas checksum erasure_code compression target high_priority pending stripes" -- "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__recover__super)
            opts="-d -o -l -s -i -y -v -h --dev_size --offset --scan_len --src_device --dev_idx --yes --verbose --help <DEVICE>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --dev_size)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -d)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --offset)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -o)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --scan_len)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -l)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --src_device)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -s)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --dev_idx)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -i)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__recovery__pass)
            opts="-s -u -h --set --unset --help <DEVICES>..."
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --set)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -s)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --unset)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -u)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__reflink__option__propagate)
            opts="-h --set-may-update --help <files>..."
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__remove__passphrase)
            opts="-h --help <DEVICES>..."
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__reset__counters)
            opts="-h --help <fs>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__scrub)
            opts="-m -h --metadata --help <FILESYSTEM>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__set__file__option)
            opts="-h --data-replicas --data_replicas --data-checksum --data_checksum --compression --background-compression --background_compression --foreground-target --foreground_target --background-target --background_target --promote-target --promote_target --erasure-code --erasure_code --casefold --inodes-32bit --inodes_32bit --project --nocow --remove-all --help <files>..."
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --data_replicas)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --data-replicas)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --data_checksum)
                    COMPREPLY=($(compgen -W "none crc32c crc64 xxhash" -- "${cur}"))
                    return 0
                    ;;
                --data-checksum)
                    COMPREPLY=($(compgen -W "none crc32c crc64 xxhash" -- "${cur}"))
                    return 0
                    ;;
                --compression)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --background_compression)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --background-compression)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --foreground_target)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --foreground-target)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --background_target)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --background-target)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --promote_target)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --promote-target)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --erasure_code)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --erasure-code)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --casefold)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --inodes_32bit)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --inodes-32bit)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --project)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --nocow)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__set__fs__option)
            opts="-d -h --block-size --block_size --btree-node-size --btree_node_size --errors --write-error-timeout --write_error_timeout --metadata-replicas --metadata_replicas --data-replicas --data_replicas --encoded-extent-max --encoded_extent_max --metadata-checksum --metadata_checksum --data-checksum --data_checksum --checksum-err-retry-nr --checksum_err_retry_nr --compression --background-compression --background_compression --str-hash --str_hash --metadata-target --metadata_target --foreground-target --foreground_target --background-target --background_target --promote-target --promote_target --erasure-code --erasure_code --casefold --casefold-disabled --casefold_disabled --inodes-32bit --inodes_32bit --shard-inode-numbers-bits --shard_inode_numbers_bits --btree-node-mem-ptr-optimization --btree_node_mem_ptr_optimization --gc-reserve-percent --gc_reserve_percent --gc-reserve-bytes --gc_reserve_bytes --root-reserve-percent --root_reserve_percent --wide-macs --wide_macs --inline-data --inline_data --promote-whole-extents --promote_whole_extents --acl --usrquota --grpquota --prjquota --degraded --no-splitbrain-check --no_splitbrain_check --verbose --journal-flush-delay --journal_flush_delay --journal-flush-disabled --journal_flush_disabled --journal-reclaim-delay --journal_reclaim_delay --writeback-timeout --writeback_timeout --move-bytes-in-flight --move_bytes_in_flight --move-ios-in-flight --move_ios_in_flight --fsck --fsck-memory-usage-percent --fsck_memory_usage_percent --fix-errors --fix_errors --ratelimit-errors --ratelimit_errors --nochanges --norecovery --journal-rewind --journal_rewind --recovery-passes --recovery_passes --recovery-passes-exclude --recovery_passes_exclude --recovery-pass-last --recovery_pass_last --journal-transaction-names --journal_transaction_names --allocator-stuck-timeout --allocator_stuck_timeout --noexcl --direct-io --direct_io --reconstruct-alloc --reconstruct_alloc --version-upgrade --version_upgrade --nocow --nocow-enabled --nocow_enabled --copygc-enabled --copygc_enabled --reconcile-enabled --reconcile_enabled --reconcile-on-ac-only --reconcile_on_ac_only --auto-snapshot-deletion --auto_snapshot_deletion --state --bucket-size --bucket_size --durability --data-allowed --data_allowed --discard --rotational --btree-node-prefetch --btree_node_prefetch --dev-idx --help <devices>..."
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --block_size)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --block-size)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --btree_node_size)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --btree-node-size)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --errors)
                    COMPREPLY=($(compgen -W "continue fix_safe panic ro" -- "${cur}"))
                    return 0
                    ;;
                --write_error_timeout)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --write-error-timeout)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --metadata_replicas)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --metadata-replicas)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --data_replicas)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --data-replicas)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --encoded_extent_max)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --encoded-extent-max)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --metadata_checksum)
                    COMPREPLY=($(compgen -W "none crc32c crc64 xxhash" -- "${cur}"))
                    return 0
                    ;;
                --metadata-checksum)
                    COMPREPLY=($(compgen -W "none crc32c crc64 xxhash" -- "${cur}"))
                    return 0
                    ;;
                --data_checksum)
                    COMPREPLY=($(compgen -W "none crc32c crc64 xxhash" -- "${cur}"))
                    return 0
                    ;;
                --data-checksum)
                    COMPREPLY=($(compgen -W "none crc32c crc64 xxhash" -- "${cur}"))
                    return 0
                    ;;
                --checksum_err_retry_nr)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --checksum-err-retry-nr)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --compression)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --background_compression)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --background-compression)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --str_hash)
                    COMPREPLY=($(compgen -W "crc32c crc64 siphash" -- "${cur}"))
                    return 0
                    ;;
                --str-hash)
                    COMPREPLY=($(compgen -W "crc32c crc64 siphash" -- "${cur}"))
                    return 0
                    ;;
                --metadata_target)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --metadata-target)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --foreground_target)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --foreground-target)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --background_target)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --background-target)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --promote_target)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --promote-target)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --erasure_code)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --erasure-code)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --casefold)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --casefold_disabled)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --casefold-disabled)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --inodes_32bit)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --inodes-32bit)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --shard_inode_numbers_bits)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --shard-inode-numbers-bits)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --btree_node_mem_ptr_optimization)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --btree-node-mem-ptr-optimization)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --gc_reserve_percent)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --gc-reserve-percent)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --gc_reserve_bytes)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --gc-reserve-bytes)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --root_reserve_percent)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --root-reserve-percent)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --wide_macs)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --wide-macs)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --inline_data)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --inline-data)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --promote_whole_extents)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --promote-whole-extents)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --acl)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --usrquota)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --grpquota)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --prjquota)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --degraded)
                    COMPREPLY=($(compgen -W "ask yes very no" -- "${cur}"))
                    return 0
                    ;;
                --no_splitbrain_check)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --no-splitbrain-check)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --verbose)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --journal_flush_delay)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --journal-flush-delay)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --journal_flush_disabled)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --journal-flush-disabled)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --journal_reclaim_delay)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --journal-reclaim-delay)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --writeback_timeout)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --writeback-timeout)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --move_bytes_in_flight)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --move-bytes-in-flight)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --move_ios_in_flight)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --move-ios-in-flight)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --fsck)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --fsck_memory_usage_percent)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --fsck-memory-usage-percent)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --fix_errors)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --fix-errors)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --ratelimit_errors)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --ratelimit-errors)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --nochanges)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --norecovery)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --journal_rewind)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --journal-rewind)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --recovery_passes)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --recovery-passes)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --recovery_passes_exclude)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --recovery-passes-exclude)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --recovery_pass_last)
                    COMPREPLY=($(compgen -W "recovery_pass_empty scan_for_btree_nodes check_topology accounting_read alloc_read stripes_read initialize_subvolumes snapshots_read check_allocations trans_mark_dev_sbs fs_journal_alloc set_may_go_rw journal_replay merge_btree_nodes check_alloc_info check_lrus check_btree_backpointers check_backpointers_to_extents check_extents_to_backpointers check_alloc_to_lru_refs fs_freespace_init bucket_gens_init reconstruct_snapshots delete_dead_interior_snapshots check_snapshot_trees check_snapshots check_subvols check_subvol_children delete_dead_snapshots fs_upgrade_for_subvolumes check_inodes check_extents check_indirect_extents check_dirents check_xattrs check_root check_unreachable_inodes check_subvolume_structure check_directory_structure check_nlinks check_reconcile_work resume_logged_ops delete_dead_inodes kill_i_generation_keys fix_reflink_p set_fs_needs_reconcile btree_bitmap_gc lookup_root_inode" -- "${cur}"))
                    return 0
                    ;;
                --recovery-pass-last)
                    COMPREPLY=($(compgen -W "recovery_pass_empty scan_for_btree_nodes check_topology accounting_read alloc_read stripes_read initialize_subvolumes snapshots_read check_allocations trans_mark_dev_sbs fs_journal_alloc set_may_go_rw journal_replay merge_btree_nodes check_alloc_info check_lrus check_btree_backpointers check_backpointers_to_extents check_extents_to_backpointers check_alloc_to_lru_refs fs_freespace_init bucket_gens_init reconstruct_snapshots delete_dead_interior_snapshots check_snapshot_trees check_snapshots check_subvols check_subvol_children delete_dead_snapshots fs_upgrade_for_subvolumes check_inodes check_extents check_indirect_extents check_dirents check_xattrs check_root check_unreachable_inodes check_subvolume_structure check_directory_structure check_nlinks check_reconcile_work resume_logged_ops delete_dead_inodes kill_i_generation_keys fix_reflink_p set_fs_needs_reconcile btree_bitmap_gc lookup_root_inode" -- "${cur}"))
                    return 0
                    ;;
                --journal_transaction_names)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --journal-transaction-names)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --allocator_stuck_timeout)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --allocator-stuck-timeout)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --noexcl)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --direct_io)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --direct-io)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --reconstruct_alloc)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --reconstruct-alloc)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --version_upgrade)
                    COMPREPLY=($(compgen -W "compatible incompatible none" -- "${cur}"))
                    return 0
                    ;;
                --version-upgrade)
                    COMPREPLY=($(compgen -W "compatible incompatible none" -- "${cur}"))
                    return 0
                    ;;
                --nocow)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --nocow_enabled)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --nocow-enabled)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --copygc_enabled)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --copygc-enabled)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --reconcile_enabled)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --reconcile-enabled)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --reconcile_on_ac_only)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --reconcile-on-ac-only)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --auto_snapshot_deletion)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --auto-snapshot-deletion)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --state)
                    COMPREPLY=($(compgen -W "rw ro evacuating spare" -- "${cur}"))
                    return 0
                    ;;
                --bucket_size)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --bucket-size)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --durability)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --data_allowed)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --data-allowed)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --discard)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --rotational)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --btree_node_prefetch)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --btree-node-prefetch)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --dev-idx)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -d)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__set__passphrase)
            opts="-h --help <DEVICES>..."
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__show__super)
            opts="-f -F -l --help --fields --field-only --layout <DEVICE>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --fields)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -f)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --field-only)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -F)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__strip__alloc)
            opts="-h --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__subvolume)
            opts="-h --help create new delete del snapshot snap list ls list-snapshots ls-snap list-snap help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__subvolume)
            opts="-h --help create new delete del snapshot snap list ls list-snapshots ls-snap list-snap help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__subvolume__create)
            opts="-h --help <TARGETS>..."
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__subvolume__create)
            opts="-h --help <TARGETS>..."
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__subvolume__delete)
            opts="-h --help <TARGETS>..."
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__subvolume__delete)
            opts="-h --help <TARGETS>..."
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__subvolume__help)
            opts="create delete snapshot list list-snapshots help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__subvolume__help__create)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__subvolume__help__delete)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__subvolume__help__help)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__subvolume__help__list)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__subvolume__help__list__snapshots)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__subvolume__help__snapshot)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__subvolume__list)
            opts="-t -R -s -h --json --tree --recursive --snapshots --readonly --sort --help <TARGET>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --sort)
                    COMPREPLY=($(compgen -W "name size time" -- "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__subvolume__list)
            opts="-t -R -s -h --json --tree --recursive --snapshots --readonly --sort --help <TARGET>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --sort)
                    COMPREPLY=($(compgen -W "name size time" -- "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__subvolume__list__snapshots)
            opts="-f -h --flat --json --readonly --sort --help <TARGET>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --sort)
                    COMPREPLY=($(compgen -W "name size time" -- "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__subvolume__list__snapshots)
            opts="-f -h --flat --json --readonly --sort --help <TARGET>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --sort)
                    COMPREPLY=($(compgen -W "name size time" -- "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__subvolume__list__snapshots)
            opts="-f -h --flat --json --readonly --sort --help <TARGET>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --sort)
                    COMPREPLY=($(compgen -W "name size time" -- "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__subvolume__snapshot)
            opts="-r -h --read-only --help [SOURCE] <DEST>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__subvolume__snapshot)
            opts="-r -h --read-only --help [SOURCE] <DEST>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__undump)
            opts="-f -h --force --help <FILES>..."
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__unlock)
            opts="-c -k -f -h --check --keyring --file --help <DEVICE>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --keyring)
                    COMPREPLY=($(compgen -W "session user user_session" -- "${cur}"))
                    return 0
                    ;;
                -k)
                    COMPREPLY=($(compgen -W "session user user_session" -- "${cur}"))
                    return 0
                    ;;
                --file)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -f)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        bcachefs__version)
            opts="-h --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
    esac
}

if [[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 || "${BASH_VERSINFO[0]}" -gt 4 ]]; then
    complete -F _bcachefs -o nosort -o bashdefault -o default bcachefs
else
    complete -F _bcachefs -o bashdefault -o default bcachefs
fi
