Bug#923878: bash-completion: unrar completion doesn't suggest *.rar files immedietly, but requires options first (uneeded)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug#923878: bash-completion: unrar completion doesn't suggest *.rar files immedietly, but requires options first (uneeded)

Witold Baryluk-2
Package: bash-completion
Version: 1:2.8-5
Severity: normal

Dear Maintainer,

lets consider this session with bash and unrar:

user@debian:~/Downloads/n$ ls -1
somethingelse.txt
'Notes of Obsession 1.0.0.7 x64.rar'
user@debian:~/Downloads/n$ unrar <TAB>
e   l   lb  lt  p   t   v   vb  vt  x  
user@debian:~/Downloads/n$ unrar -<TAB>
-ad    -av-   -cfg-  -cu    -ep    -idp   -inul  -o+    -ow    -p-    -ta    -tn    -u     -ver   -x     -y    
-ap    -c-    -cl    -dh    -f     -ierr  -kb    -o-    -p     -r     -tb    -to    -v     -vp    -x@    
user@debian:~/Downloads/n$ unrar x <TAB>Notes\ of\ Obsession\ 1.0.0.7\ x64.rar

However, unrar with .rar file and no 'x' works perfectly too, and is my prefered way of using it 99% of the time, but it is not suggested in completions:

I.e.

user@debian:~/Downloads/n$ unrar <TAB>  (no .rar file suggested)

but:

user@debian:~/Downloads/n$ unrar Notes\ of\ Obsession\ 1.0.0.7\ x64.rar


unrar 0.0.1  Copyright (C) 2004  Ben Asselstine, Jeroen Dekkers
Extracting from /home/user/Downloads/n/Notes of Obsession 1.0.0.7 x64.rar

Extracting  Notes of Obsession.exe                                    OK        
Extracting  Engine/Binaries/ThirdParty/ICU/icu4c-53_1/Win64/VS2015/icudt53.dll OK        
Extracting  Engine/Binaries/ThirdParty/ICU/icu4c-53_1/Win64/VS2015/icudtd53.dll OK        
...
All OK
user@debian:~/Downloads/n$ cd ..


So I think unrar completion should be updated.

unzip completion works in more intuitive way, where it completes immedietly .zip files, directories, and few other file types (i.e. *.exe files, that could be self extracting), without any options.

Thanks.



-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.19.0-2-amd64 (SMP w/32 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

-- no debconf information

Reply | Threaded
Open this post in threaded view
|

Bug#923878: bash-completion: unrar completion doesn't suggest *.rar files immedietly, but requires options first (uneeded)

Gabriel F. T. Gomes-2
On Wed, Mar 06 2019, Witold Baryluk wrote:

>
> user@debian:~/Downloads/n$ unrar Notes\ of\ Obsession\ 1.0.0.7\ x64.rar
>
> unrar 0.0.1  Copyright (C) 2004  Ben Asselstine, Jeroen Dekkers
> Extracting from /home/user/Downloads/n/Notes of Obsession 1.0.0.7 x64.rar
>
> Extracting  Notes of Obsession.exe                                    OK        
> Extracting  Engine/Binaries/ThirdParty/ICU/icu4c-53_1/Win64/VS2015/icudt53.dll OK        
> Extracting  Engine/Binaries/ThirdParty/ICU/icu4c-53_1/Win64/VS2015/icudtd53.dll OK        
> ...
> All OK

Where did you get that unrar from?

On my system, unrar is provided by the unrar package, and the version is
quite different:

  $ unrar | head -n 2
 
  UNRAR 5.61 beta 1 freeware      Copyright (c) 1993-2018 Alexander Roshal

Also, if I try to unpack a file without the 'x' option, it prints the
'usage' message, then exit with an error code:

  $ unrar pack.rar
 
  UNRAR 5.61 beta 1 freeware      Copyright (c) 1993-2018 Alexander Roshal
 
  Usage:     unrar <command> -<switch 1> -<switch N> <archive> <files...>
                 <@listfiles...> <path_to_extract\>
  (...)

  $ echo $?
  7

Whereas with 'unrar x pack.rar', it works correctly:

  $ unrar x pack.rar
 
  UNRAR 5.61 beta 1 freeware      Copyright (c) 1993-2018 Alexander Roshal
 
 
  Extracting from pack.rar
 
  Extracting  file                                                      OK
  Extracting  file.ext                                                  OK
  All OK
  $ echo $?
  0

Thus, I think that bash-completion is doing the right thing.

Reply | Threaded
Open this post in threaded view
|

Bug#923878: bash-completion: unrar completion doesn't suggest *.rar files immedietly, but requires options first (uneeded)

Witold Baryluk-2
In reply to this post by Witold Baryluk-2
Package: bash-completion
Version: 1:2.8-5
Followup-For: Bug #923878

Hi Gabriel,

I am using a free version of unrar, in package unrar-free in main repo of Debian:

unrar --help
Usage: unrar [OPTION...] ARCHIVE [FILE...] [DESTINATION]
Extract files from rar archives.

  -x, --extract              Extract files from archive (default)
  -t, --list                 List files in archive
  -f, --force                Overwrite files when extracting
      --extract-newer        Only extract newer files from the archive
      --extract-no-paths     Don't create directories while extracting
  -p, --password             Decrypt archive using a password
  -?, --help                 Give this help list
      --usage                Give a short usage message
  -V, --version              Print program version

Report bugs to <[hidden email]>.
$

Note that OPTION part is optional, i.e. -x / --extract is default.



$ unrar-free --version
unrar 0.0.1
$ unrar --version
unrar 0.0.1
$

$ dpkg -l unrar-free
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version               Architecture Description
+++-==============-=====================-============-=================================
ii  unrar-free     1:0.0.1+cvs20140707-4 amd64        Unarchiver for .rar files

$ dpkg -L unrar-free
/.
/usr
/usr/bin
/usr/bin/unrar-free
/usr/share
/usr/share/doc
/usr/share/doc/unrar-free
/usr/share/doc/unrar-free/README.Debian
/usr/share/doc/unrar-free/changelog.Debian.gz
/usr/share/doc/unrar-free/changelog.gz
/usr/share/doc/unrar-free/copyright
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/unrar-free
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/unrar-free.1.gz
/usr/share/unrar-free
/usr/share/unrar-free/misc
/usr/share/unrar-free/misc/tarar.pike


$ apt-cache show unrar-free
Package: unrar-free
Version: 1:0.0.1+cvs20140707-4
Installed-Size: 72
Maintainer: Ying-Chun Liu (PaulLiu) <[hidden email]>
Architecture: amd64
Depends: libc6 (>= 2.15)
Recommends: unar
Suggests: pike8.0 | pike7.8 | pike7.6 | pike
Conflicts: unrar-nonfree (<< 1:3.7.8-1)
Description-en: Unarchiver for .rar files
 Unrar can extract files from .rar archives. Can't handle some archives in
 the RAR 3.0 format natively. Package "unar" can be used to extract those
 archives if installed.
Description-md5: ec1032a402cf223268dffa022fd9536b
Homepage: https://gna.org/projects/unrar/
Tag: implemented-in::c, interface::commandline, role::program,
 scope::utility, use::compressing, works-with::archive
Section: utils
Priority: optional
Filename: pool/main/u/unrar-free/unrar-free_0.0.1+cvs20140707-4_amd64.deb
Size: 25132
MD5sum: 9d31bb0d4d714a8e2fb25bc01fd25f6f
SHA256: 8b2113d348e065ce71cffab1e15d86102d242efd082d692a9818914d9f8ca36b

$

It always served me well, and does support solid and multi file archives,
and essentially never failed me.

The one you tested is from non-free repo AFAIK.




-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.19.0-2-amd64 (SMP w/32 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

-- no debconf information

Reply | Threaded
Open this post in threaded view
|

Bug#923878: bash-completion: unrar completion doesn't suggest *.rar files immedietly, but requires options first (uneeded)

Gabriel F. T. Gomes-2
On Wed, Apr 10 2019, Witold Baryluk wrote:
>
> I am using a free version of unrar, in package unrar-free in main repo of Debian:
>
> [...]
>
> $ unrar-free --version
> unrar 0.0.1
> $ unrar --version
> unrar 0.0.1

Oh, I see.  Thanks for the explanation.

> Note that OPTION part is optional, i.e. -x / --extract is default.

I guess you are right.  I'll work on it.