getchr - ask user to type a character
Getchr will print its prompt and ask the user for a single
character. If that character is in the string of legal response
characters (legals), then its index is returned. If a null string
is typed (just a carriage return), then the default character
(defalt) will be assumed and its index returned. If a character is
typed which is not in the string of legal responses, then an error
message is printed and the prompt-and-response cycle is repeated.
getbool(3), getstr(3), getstab(3), etc.
There is no provision for an escape response (e.g. "I don’t like
any of these choices").