make options (more) compatible with xz
A Debian user (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=714126) asks about using pixz as a drop in replacement for the xz command from xz-utils. Currently this does not seem very feasible to me since among other things the options are not very compatible.
Feel free to close this issue if you think it will not be feasible in the long term either.
I don't intend on vastly changing the options to pixz for awhile, I don't want to break people's scripts. Also, some of the options are fundamentally different: Tarball listing and partial extraction are exclusive to pixz, I doubt xz will ever support that. Things like raw lzma support are in xz, but I don't think pixz can support them realistically.
I would, however, be very happy to see a wrapper for pixz that's xz-compatible to some degree. It wouldn't be terribly hard to write a shell script to handle the most common xz options and translate them to pixz.
If the user wants to use Debian alternatives though, that's a bit harder, since pixz might get passed any xz option, even ones like --robot that I don't anticipate implementing. I guess a wrapper could detect unsupported options and fall back to xz?
Hi,
can you at least add the -c option (alias --stdout), which is very common with gzip, bzip2 and xz, having commands like: "gzip -cd file.gz > stdout.file".
Otherwise, I had to do "pixz -d file.xz /dev/pts/1 > stdout.file" which is kinda overkill.
Thanks, Fab
@havingAgithubAccountIsBuggingMe: There are already two ways to do this:
- If you specify no input or output, pixz will use stdin and stdout, eg:
pixz -d < file.xz > stdout.file - If you use the i/o options, pixz will substitute stdin/stdout for any that are missing:
pixz -i file.xz > stdout.file
Sorry that the input/output options are so confusing!
Now, the alpha version of xz-util supports multithread. See https://sourceforge.net/p/lzmautils/discussion/708858/thread/d37155d1/.
Just add
XZ_DEFAULTS="--threads 0"
to your environment variable!
I have added a list of differences to xz, including the present incompatibilities, see https://github.com/vasi/pixz#differences-to-xz.
Don't forget that pixz does parallel DEcompression, too ☺
I have started a branch to address this issue. I consider this branch ready to be merged when the following conditions are met:
-
pixzis compatible toxzin (lets just call it) the main compression tool command line options:
-
-c,--stdout -
-z,--compress -
-d,--decompress
Please let me know if I forgot another option that allows pixz to be used as a drop-in replacement for xz. I do not know all tools that may or may not allow pixz to be used as a drop-in replacement for xz and what command line options these require. Would be nice to get some pointers on that.
2. All matching long options are supported.
3. All command line options have tests associated with them which assure they work correctly and are compatible to xz.
As @vasi mentioned earlier, there are some command line options / behaviours that work differently on pixz. Dropping those in favor of full command line usage compatibility with xz is a breaking change. It will definitely require that we bump version to 2.0.0 (semantic versioning) and we may hold off on that for a bit.
@vasi xz does no parallel decompression, only parallel compression?
Indeed, I just checked. I will list this difference.