RFR 8179856: jshell tool: not suitable for pipeline use
Jan Lahoda
jan.lahoda at oracle.com
Thu Oct 19 15:25:16 UTC 2017
Looking at l10n.properties, isn't the --help-extra text duplicated?
-\ --help-extra, -X Print help on non-standard options and exit\n
+\ --help-extra, -X Print help on non-standard options and exit\n\
+\ --help-extra, -X Print help on non-standard options and exit\n\
Otherwise looks OK, no need to another review.
Jan
On 16.10.2017 09:18, Robert Field wrote:
> Thanks Jan!
>
> During CSR review, John pointed out problems with the --help text
> (suggesting an alternative) and one case where fluff (informative
> non-essential information) is printed for a load file (including "-")
> and the fluff is wrong (for load files).
>
> The new webrev is here:
>
> http://cr.openjdk.java.net/~rfield/8179856v5.webrev/
>
> But all that changed is the --help output, instead of my poorly crafted
> words, now ends with:
>
> A file argument may be a file name, or one of the predefined file
> names: DEFAULT,
> PRINTING, or JAVASE.
> A load file may also be "-" to indicate standard input, without
> interactive I/O.
>
> And on unexpected termination, the output has been broken into two parts:
>
> jshell.msg.terminated = State engine terminated.
> jshell.msg.terminated.restore = Restore definitions with: /reload
> -restore
>
> The latter is now printed as fluff (and thus not showing up for load
> files or quiet feedback modes):
>
> shutdownSubscription = state.onShutdown((JShell deadState) -> {
> if (deadState == state) {
> hardmsg("jshell.msg.terminated");
> + fluffmsg("jshell.msg.terminated.restore");
> live = false;
> }
> });
>
> And, of course, the test files are in their new post-consolidation
> locations.
>
> Thanks,
> Robert
>
> On 09/15/17 02:49, Jan Lahoda wrote:
>> Seems OK to me.
>>
>> Jan
>>
>> On 13.9.2017 04:17, Robert Field wrote:
>>> Please review updated webrev (now uses file "-" rather than option
>>> "--pipe") --
>>>
>>> Bugs:
>>>
>>> 8179856: jshell tool: not suitable for pipeline use
>>> https://bugs.openjdk.java.net/browse/JDK-8179856
>>>
>>> 8186708: jshell tool: bad load file garbles message and does not
>>> abort
>>> https://bugs.openjdk.java.net/browse/JDK-8186708
>>>
>>> Webrev:
>>>
>>> http://cr.openjdk.java.net/~rfield/8179856v2.webrev/
>>>
>>> Thanks,
>>> Robert
>>>
>>>
>>> On 09/12/17 12:53, Robert Field wrote:
>>>> I like it!
>>>>
>>>> Both because it is clean and a standard.
>>>> I agree that considering stdin exhausted (so exiting after) makes
>>>> sense.
>>>>
>>>> It will mean somewhat of a rewrite, but that’s fine.
>>>>
>>>> I’ll redo and send out.
>>>>
>>>> -Robert
>>>>
>>>>> On Sep 12, 2017, at 8:47 AM, Jan Lahoda <jan.lahoda at oracle.com> wrote:
>>>>>
>>>>> What would happen if we processed "-" (stdin) as a file? One
>>>>> difference I see is that after processing the files, the interactive
>>>>> shell is started unless there is an explicit /exit in the files. But
>>>>> given we have already processed the stdin, it would seem OK to me to
>>>>> not start the interactive part (there's an EOF at the end of the
>>>>> stdin, I assume, which for stdin could be seen as an explicit /exit).
>>>>>
>>>>> I also tried bash:
>>>>> $ echo 'echo X' | bash -
>>>>> X
>>>>>
>>>>> Jan
>>>>>
>>>>> On 11.9.2017 18:35, Robert Field wrote:
>>>>>> On 09/11/17 02:30, Jan Lahoda wrote:
>>>>>>> Hi Robert,
>>>>>>>
>>>>>>> Overall seems OK to me. One question: why use "--pipe" instead of
>>>>>>> simply "-" (which is AFAIK common option for "read stdin")?
>>>>>> From Linux "cat" -----
>>>>>>
>>>>>> SYNOPSIS
>>>>>> cat [OPTION]... [FILE]...
>>>>>>
>>>>>> DESCRIPTION
>>>>>> ...
>>>>>>
>>>>>> With no FILE, or when FILE is -, read standard input.
>>>>>>
>>>>>> EXAMPLES
>>>>>> cat f - g
>>>>>> Output f's contents, then standard input, then g's
>>>>>> contents.
>>>>>>
>>>>>> cat Copy standard input to standard output.
>>>>>>
>>>>>> ------------
>>>>>>
>>>>>> The jshell tool always reads from standard in (unless somehow
>>>>>> aborted).
>>>>>> This "--pipe" argument is an option, whereas "-" in the *nix world
>>>>>> is a
>>>>>> file.
>>>>>>
>>>>>> The option does not change what is read, but how it is processed.
>>>>>>
>>>>>> But maybe that is too pedantic, and it still the natural choice.
>>>>>>
>>>>>> Thoughts?
>>>>>>
>>>>>> -Robert
>>>>>>
>>>>>>
>>>>>>> Jan
>>>>>>>
>>>>>>> On 24.8.2017 06:35, Robert Field wrote:
>>>>>>>> Please review --
>>>>>>>>
>>>>>>>> Bugs:
>>>>>>>>
>>>>>>>> 8179856: jshell tool: not suitable for pipeline use
>>>>>>>> https://bugs.openjdk.java.net/browse/JDK-8179856
>>>>>>>>
>>>>>>>> 8186708: jshell tool: bad load file garbles message and
>>>>>>>> does not
>>>>>>>> abort
>>>>>>>> https://bugs.openjdk.java.net/browse/JDK-8186708
>>>>>>>>
>>>>>>>> Webrev:
>>>>>>>>
>>>>>>>> http://cr.openjdk.java.net/~rfield/8179856v1.webrev/
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Robert
>>>>>>>>
>>>
>
More information about the kulla-dev
mailing list