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

Add a list subcommand for printing the contents of a compressed file or archive #6

Closed
vrmiguel opened this issue Mar 29, 2021 · 4 comments
Assignees
Labels
enhancement New feature or request high priority
Milestone

Comments

@vrmiguel
Copy link
Member

No description provided.

@vrmiguel vrmiguel added the enhancement New feature or request label Mar 29, 2021
@vrmiguel vrmiguel self-assigned this Mar 29, 2021
@VuiMuich
Copy link

VuiMuich commented Sep 5, 2021

Hi first of all congrats, I really like this project!

IMO this one could be higher priority, as it would be very helpful in daily use.
I like to check archives bevor decompressing, whether they have subfolders or all the files in archive-root and depending on that set an output-path or not.

As a secondary enhancement -t | --tree and -d | --depth flags for the list subcommand might be nice additions.

@marcospb19
Copy link
Member

@VuiMuich originally we planned on having --tree enable by default, however, that's not friendly for piping into another program or using as arguments in scripts.

So maybe we should have a way to output it without the extra tree formatting, what do you think? Do you have any flag suggestions?

@VuiMuich
Copy link

VuiMuich commented Sep 10, 2021

Oh, this totaly makes sense, piping a visually appealing tree is of little to no use 😄

In the spirit of #48 I was thinking of something like this:

$ ouch list example.zip
example.zip/File1
example.zip/Folder1
example.zip/Foler1/AnotherFile1
example.zip/Folder2
example.zip/Folder2/SubFolder1
example.zip/Folder2/Subfolder1/ThisFileIsDeep

$ ouch list --tree example.zip
example.zip
   ├   File1
   ├  Folder1
   |   └   AnotherFile1
   └   Folder2
       └   Subfolder1
           └   ThisFileIsDeep

$ ouch list --depth 1 example.zip
example.zip
./File1
./Folder1
./Foler1/AnotherFile1
./Folder2
./Folder2/SubFolder1

$ ouch list -t -d 1 example.zip
example.zip
   ├   File1
   ├   Folder1
   |   └   AnotherFile1
   └   Folder2
       └   Subfolder1

ouch list --files-only example.zip
$ ouch list example.zip
example.zip/File1
example.zip/Foler1/AnotherFile1
example.zip/Folder2/Subfolder1/ThisFileIsDeep

While writing this the idea of last example came to mind to have flags for --files-only and --dirs-only

@marcospb19
Copy link
Member

Implemented in #129.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high priority
Projects
None yet
Development

No branches or pull requests

3 participants