# shellcheck shell=sh disable=SC2034,SC2154,SC3043

### Section: cat zip file, following the list of files to cat ...

___x_cmd_zuz_info(){

    local target_file="${1:-filename}"; shift
    case "$target_file" in
        *.tar)
            LC_ALL="$___X_CMD_LOCALE_DEF_C" ___x_cmd_zuz_run tar -t <"$target_file"  # bsdtar
            ;;
        *.tar.gz)
            LC_ALL="$___X_CMD_LOCALE_DEF_C" ___x_cmd_zuz_run tar -t <"$target_file"  # bsdtar
            ;;
        *.tar.Z)
            LC_ALL="$___X_CMD_LOCALE_DEF_C" ___x_cmd_zuz_run tar -t <"$target_file"  # bsdtar
            ;;
        *.bz2)
            LC_ALL="$___X_CMD_LOCALE_DEF_C" ___x_cmd_zuz_run tar -t <"$target_file"  # bsdtar
            ;;
        *.tgz)
            ___x_cmd_zuz_run gzip --list "$target_file"
            ;;
        *.xz)
            zuz:error "Unsupported to list xz file.">&2
            return 1
            ;;
        *.zst)
            ___x_cmd_zuz_run ___x_cmd zstd -l "$target_file"
            ;;
        *.zip)
            ___x_cmd_zuz_run ___x_cmd 7z l -ba "$target_file"  # bsdtar
            ;;
        *.rar)
            # x unrar
            zuz:error "Unsupported to list rar file.">&2
            return 1
            ;;
        *.7z)
            ___x_cmd_zuz_run ___x_cmd 7z l -ba "$target_file" | ___x_cmd_cmds_awk '{ print $NF }'
            ;;
        *)
            ___x_cmd_zuz --help; zuz:warn "Unsupported to resolve as $target_file format.";
            return 1
            ;;
    esac
}
# EndSection
