[ 
https://issues.apache.org/jira/browse/HDFS-1958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13035898#comment-13035898
 ] 

Todd Lipcon commented on HDFS-1958:
-----------------------------------

well, fsck for example supports either 'y' or 'Y' for yes, and 'n' or 'N' for 
no.

fsck also does the following which we can't replicate in Java:
{code}
        tcgetattr (0, &termios);
        tmp = termios;
        tmp.c_lflag &= ~(ICANON | ECHO);
        tmp.c_cc[VMIN] = 1;
        tmp.c_cc[VTIME] = 0;
        tcsetattr (0, TCSANOW, &tmp);
{code}
so that it can do an unbuffered read of a single keypress from stdin. Thus if 
you start to type "yes" or "no" it will see the "y" or "n" and act as expected.

Since we can't do that, accepting "yes" or "no" seems like a good idea!

[to satisfy Allen's inevitable gripe, I'm referring to the Linux-specific 
e2fsck behavior here]

> Format confirmation prompt should be more lenient of its input
> --------------------------------------------------------------
>
>                 Key: HDFS-1958
>                 URL: https://issues.apache.org/jira/browse/HDFS-1958
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: name-node
>    Affects Versions: 0.22.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>             Fix For: 0.22.0
>
>         Attachments: hdfs-1958.txt
>
>
> As reported on the mailing list, the namenode format prompt only accepts 'Y'. 
> We should also accept 'y' and 'yes' (non-case-sensitive).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to