Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Standard format for yes/no questions in the terminal?

Over the years I've seen many different ways of solving the problem of asking the user a simple yes/no question with a default value in the terminal. But in the interest of standardization, does any kind of standard for doing this exist ?

Some of the different ways I've seen, plus a few examples dug up by googling include:

... (Y,N) [N]? Y
... (Y/N) ?  [Default=Y]
... [Y/n]?
... ([y]/n)?
...? [y/[n]]
like image 790
CSkau Avatar asked Oct 18 '11 07:10

CSkau


People also ask

What is the formula of yes no question?

We form yes-no questions with an auxiliary verb (be, do or have) + subject + main verb or with a modal verb + subject + main verb: Be: Is she working very hard? Were they travelling together? Do: Does that taste okay?

How to answer yes no questions in english?

You can answer with a simple “yes” or “no.” But, suppose you wanted to answer with something a little longer. When we answer yes or no questions, we do not usually repeat the full question. Instead, we answer with the auxiliary or modal from the question.


1 Answers

Extensive googling and other forms of searching do not turn up anything on the matter, which leads me to believe that there is no such standard because, well, there is no point in standardizing something this trivial.

Standards usually exist to prevent people from writing custom protocols for everything and creating isolated islands of software that are not compatible with each other, and a yes/no question is something typically presented to a human user who is able to figure it out even if it's in a bizarre form like "... {Y3s\n0} !>".

If you really want to be as "standard" as possible, the following format seems to be the most common:

... [Y/n]

With the recommended/default option being capitalized, usually only requiring correct casing when no is the recommended option but.

like image 118
Llamageddon Avatar answered Oct 14 '22 06:10

Llamageddon