walles / moar

Moar is a pager. It's designed to just do the right thing without any configuration.
Other
587 stars 17 forks source link

Automatic decompression of compressed files #97

Closed nkh closed 1 year ago

nkh commented 1 year ago

IMHO, if the compressed file contains multiple files a listing should be displayed not binary data. the same goes for content that is a single file, if it is not a text file, which might include ANSI code, it should not be displayed at least without asking the user, there are better ways to look at binary, maybe a hex dump would be more useful.

walles commented 1 year ago

What kind of archives would you like to view with moar?

nkh commented 1 year ago

any compressed file but if the compressed file contains other files then a listing should be displayed, it sounds more logical than a binary dump. if it's a single file, eg: not an archive, showing a binary dump is still not very useful, on the other hand text files could be shown. it's up to you, I look at compressed files i my own viewer.

walles commented 1 year ago

I look at compressed files i my own viewer

I think I'll postpone this until there's a clearer ask.

Feel free to reopen / question this if you feel I'm taking the wrong decision here!

nkh commented 1 year ago

I must have misunderstood the documentation : Automatic decompression of compressed files (.gz, .bz2, .xz)

I thought that was already implemented!

walles commented 1 year ago

This works, and will show the same thing as moar /etc/passwd:

gzip --stdout < /etc/passwd > passwd.gz
moar passwd.gz

IIUC your expectation is that if I moar something.tar.gz, moar should:

  1. Decompress the file (as it currently does)
  2. Figure out that the uncompressed contents is really an archive, and list the archive's contents

2 is not implemented.

Do you think this should be clarified in the README?

nkh commented 1 year ago

2 is what expected; I guess other will so it may be a good idea to clarify in the docs

walles commented 1 year ago

That clarifies things, reopening!

walles commented 1 year ago

@nkh do you think this new phrasing is better?

New

Old

  • Automatic decompression of compressed files (.gz, .bz2, .xz)