From 5cd2a57e0e45bee5d9208c5830a9496a89910b33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Sun, 23 Jan 2022 13:23:31 +0200 Subject: [PATCH 1/2] feat(tar): associate with *.xbps (Void Linux package) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes https://github.com/scop/bash-completion/issues/685 Co-authored-by: Ville Skyttä --- completions/tar | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/completions/tar b/completions/tar index da3c8785871..fc72a127cd8 100644 --- a/completions/tar +++ b/completions/tar @@ -441,7 +441,7 @@ __tar_cleanup_prev() __tar_detect_ext() { - local tars='@(@(tar|gem|spkg)?(.@(Z|[bgx]z|bz2|lz?(ma|o)|zst))|t@([abglx]z|b?(z)2|zst)|cbt)' + local tars='@(@(tar|gem|spkg)?(.@(Z|[bgx]z|bz2|lz?(ma|o)|zst))|t@([abglx]z|b?(z)2|zst)|cbt|xbps)' if [[ ${COMP_WORDS[0]} == ?(*/)bsdtar ]]; then # https://github.com/libarchive/libarchive/wiki/LibarchiveFormats tars=${tars/%\)/|pax|cpio|iso|zip|@(j|x)ar|mtree|a|7z|warc} @@ -460,7 +460,7 @@ __tar_detect_ext() # Should never happen? ;; ?(-)*[cr]*f) - ext='@(tar|gem|spkg|cbt)' + ext='@(tar|gem|spkg|cbt|xpbs)' case ${words[1]} in *a*) ext="$tars" ;; *z*) ext='t?(ar.)gz' ;; From a48fae0f6785cda4c6a838b066ad956988847b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 23 Jan 2022 13:26:39 +0200 Subject: [PATCH 2/2] fix(tar): do not associate with *.gem. To my knowledge, gems are just `*.gem`, not e.g. `*.gem.xz` etc. --- completions/tar | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/completions/tar b/completions/tar index fc72a127cd8..2eac109b527 100644 --- a/completions/tar +++ b/completions/tar @@ -441,7 +441,7 @@ __tar_cleanup_prev() __tar_detect_ext() { - local tars='@(@(tar|gem|spkg)?(.@(Z|[bgx]z|bz2|lz?(ma|o)|zst))|t@([abglx]z|b?(z)2|zst)|cbt|xbps)' + local tars='@(@(tar|spkg)?(.@(Z|[bgx]z|bz2|lz?(ma|o)|zst))|t@([abglx]z|b?(z)2|zst)|cbt|gem|xbps)' if [[ ${COMP_WORDS[0]} == ?(*/)bsdtar ]]; then # https://github.com/libarchive/libarchive/wiki/LibarchiveFormats tars=${tars/%\)/|pax|cpio|iso|zip|@(j|x)ar|mtree|a|7z|warc} @@ -473,13 +473,13 @@ __tar_detect_ext() # Pass through using defaults above ;; *[Zz]*f) - ext='@(@(t?(ar.)|gem.|spkg.)@(gz|Z)|taz)' + ext='@(@(t?(ar.)|spkg.)@(gz|Z)|taz)' ;; *[jy]*f) - ext='@(@(t?(ar.)|gem.)bz?(2)|spkg|tb2)' + ext='@(t?(ar.)bz?(2)|spkg|tb2)' ;; *[J]*f) - ext='@(@(tar|gem|spkg).@(lzma|xz)|t[lx]z)' + ext='@(@(tar|spkg).@(lzma|xz)|t[lx]z)' ;; esac }