RFR [9] 8059101: unshuffle_patch.sh should be able to deal with stdin/stdout

Daniel Fuchs daniel.fuchs at oracle.com
Thu Sep 25 12:57:46 UTC 2014


On 25/09/14 12:26, Ivan Gerasimov wrote:
>
> On 25.09.2014 14:18, Daniel Fuchs wrote:
>> Hi Ivan,
>>
>> Should 'usage' also be redirected?
>>
> This would be inconsistent with other command line utilities.
> They usually print help/usage to stdout.

Right. I suspected something like that.

This looks good!

thanks,

-- daniel

>
> Sincerely yours,
> Ivan
>
>> best regards,
>>
>> -- daniel
>>
>> On 25/09/14 12:12, Ivan Gerasimov wrote:
>>> Thank you Daniel for the comments!
>>>
>>> On 25.09.2014 13:49, Daniel Fuchs wrote:
>>>> Hi Ivan,
>>>>
>>>> When setting output & input, I wonder if it would be simpler
>>>> to use an 'if else if' construct in order to avoid the '-a'
>>>> in the 'if' that follows.
>>>>
>>> We would still need that -a in if, as the user could pass /dev/stdin and
>>> /dev/stdout as the arguments to the script.
>>> Dashes are meant to be the shortcut for these long names, but we should
>>> allow the long names to be passed too.
>>>
>>>> something like this (pseudo code) might be easier to read:
>>>>
>>>> if "x$output" is "x-" then
>>>>    substitute - with /dev/stdout
>>>> else if $output file exists
>>>>    complain
>>>> endif
>>>>
>>>> Also the script uses echo to print warnings & error.
>>>> It should probably be changed to print those on stderr ( >&2 )
>>>> so that they don't mix with the patch when the output is '-'.
>>>>
>>> Agreed!
>>> Redirected all the error messages to stderr.
>>>
>>>> Similarly - I feel that either verbose should redirect to
>>>> stderr, or the script should complain and exit if output
>>>> is '-' and verbose is on.
>>>>
>>> Done.
>>>
>>> Please see the updated webrev:
>>> http://cr.openjdk.java.net/~igerasim/8059101/1/webrev/
>>>
>>> Sincerely yours,
>>> Ivan
>>>
>>
>>
>>
>



More information about the jdk9-dev mailing list