On Wed, 27 Jan 2021 10:36:54 GMT, Lin Zang <lz...@openjdk.org> wrote:
> Do you think it is reasonable to treat "gz=[number]/[non-number]" differently > in this case? or should it just exit with error for all "gz=" options that is > not in the range of compression level? BTW, I think your suggested code is > better if we consider all illegal compression level as an error. I think we should produce an error for something like `gz=abc` rather than use that as the filename, because I think it is likely user error. However, then you also need to figure out what to do with `gz=1 gz=abc`. Since the first argument is a proper `gz=` argument, you might miss the fact that the second also starts with `gz=` and accept it as a filename. Maybe in this example that is ok, but what if the user specifies `gz=1 gz=2`. Now it would seem they accidentally did two `gz=` arguments and an error should be produced, so I would suggest just always producing an error if the filename starts with `gz=`. ------------- PR: https://git.openjdk.java.net/jdk/pull/1712