Adam Tuja wrote:
zutilsrc just allows changing the command used to decompress each supported
format, but it can't be used to define new formats.

I don't want to add any new compressors. User will. And it's their
responsibility to do it right. Not yours.

It is impossible to add new compressors to zutils without modifying the code because the zutils detect the format of the data, not the extension of the file. Else they could not process data from a pipe, for example:

$ cat fox
The quick brown fox jumps over the lazy dog.
$ gzip -c fox | zgrep dog
The quick brown fox jumps over the lazy dog.
$ lzip -c fox | zgrep dog
The quick brown fox jumps over the lazy dog.

File name extensions are used to exclude files from processing, not to determine the format.

Most of zutils do not work like tar and are not scripts with a switch statement that one can expand at will. They do not contain something like this:
  case "$1" in
  *.gz) gzip -dc "$1"  2>/dev/null ;;
  *.bz2) bzip2 -dc "$1" 2>/dev/null ;;
  *.lz) lzip -dc "$1"  2>/dev/null ;;

BTW, how do you propose that zutils processes data from a pipe if the data is in an user-defined format?

What you ask requires the redesign of zutils. Currently adding a new format
requires making changes to most source files.

It's not necessary. I ask to add ability to parse extension and then use
program defined in configuration (file).

Adding an "ability" incompatible with the way zutils works, requires the redesign of zutils.


Best regards,
Antonio.

Reply via email to