dscalzi/ZipExtractor

Ability to pipe multiple operations at once.

Closed this issue · 2 comments

For example, extract .pack.xz in one go. Currently, it requires 2 extractions to complete.

Possible implementation strategy is to compare the source to dest extension and see where they differ.
Ex.
Src = C:/MyJar.jar.pack.xz
Dest = C:/MyOutJar.jar

Src ext = .jar.pack.xz
Dest ext = .jar
Difference = .pack.xz => xz | pack

Extractions are a little more difficult to resolve. With compressions, the source is compressed based on whichever extensions are present on the destination. With extractions, the source is extracted into the destination directory.

It may not be desirable to exhaust all extraction possibilities. For example, .jar.pack.xz -> .jar. Typically, people don't want to extract jar files. Best solution I can think of is to add an extra flag to the extract command.

The flag could be --until [ext]. If provided, we will try to extract until we reach the specified extraction. Ex. /ze extract --until jar would extract whatever.jar.pack.xz to whatever.jar. Not specifying the flag would result in a simple extraction of just the .xz format. We can have a macro --until all to exhaust all possibilities.

Alternatively, we can have the plugin "remember" some extensions to never pipe because they will probably never be what the user wants.

Piped Compressions implemented in 427aa74

Piped Extractions implemented in b0421f0