Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic decompression of compressed files #97

Closed
nkh opened this issue Jul 20, 2022 · 8 comments
Closed

Automatic decompression of compressed files #97

nkh opened this issue Jul 20, 2022 · 8 comments

Comments

@nkh
Copy link

nkh commented Jul 20, 2022

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
Copy link
Owner

walles commented Jul 20, 2022

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

@nkh
Copy link
Author

nkh commented Jul 20, 2022

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
Copy link
Owner

walles commented Jul 21, 2022

I look at compressed files i my own viewer

  • There are lots of zip-like file formats out there
  • I'm not sure anybody would use this even if I implemented this

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!

@walles walles closed this as completed Jul 21, 2022
@nkh
Copy link
Author

nkh commented Jul 21, 2022

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

I thought that was already implemented!

@walles
Copy link
Owner

walles commented Jul 21, 2022

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
Copy link
Author

nkh commented Jul 21, 2022

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

@walles
Copy link
Owner

walles commented Jul 21, 2022

That clarifies things, reopening!

@walles walles reopened this Jul 21, 2022
@walles walles closed this as completed in 2261709 Jul 21, 2022
@walles
Copy link
Owner

walles commented Jul 21, 2022

@nkh do you think this new phrasing is better?

New

Old

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants