From 7a72e435fa6bb4f561ed6cfceea7a19406f3ceef Mon Sep 17 00:00:00 2001 From: Kevin Locke Date: Thu, 23 Jun 2022 07:54:41 -0600 Subject: [PATCH 1/2] feat(7z): complete h i and rn commands These were added to the help output of p7zip 15.09 and are present in all versions of 7zz. Signed-off-by: Kevin Locke --- completions/7z | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/7z b/completions/7z index f2a6ef639d4..2def07c65be 100644 --- a/completions/7z +++ b/completions/7z @@ -6,7 +6,7 @@ _7z() _init_completion -n = || return if ((cword == 1)); then - COMPREPLY=($(compgen -W 'a b d e l t u x' -- "$cur")) + COMPREPLY=($(compgen -W 'a b d e h i l rn t u x' -- "$cur")) return fi From d9ca1b4a5f34f369536318a02c80aad0871f0652 Mon Sep 17 00:00:00 2001 From: Kevin Locke Date: Sat, 25 Jun 2022 19:08:07 -0600 Subject: [PATCH 2/2] feat(7z): treat rn command as mode=w MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Renaming archive members is a modify operation and can only be done for formats where writing is supported. Suggested-by: Ville Skyttä Signed-off-by: Kevin Locke --- completions/7z | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/7z b/completions/7z index 2def07c65be..8da846a5c58 100644 --- a/completions/7z +++ b/completions/7z @@ -11,7 +11,7 @@ _7z() fi local mode - [[ ${words[1]} == [adu] ]] && mode=w || mode=r + [[ ${words[1]} == @(a|d|rn|u) ]] && mode=w || mode=r case $cur in -ao*)