T. Joseph Carter 63d4ce2b51 Make askYesNo use a here document for info text
The info text for askYesNo was a problem.  First, it involved a long,
complex, paragraph encoded as string on the command line.  That's NEVER
a good idea.  Secondly, it passed that string unprocessed to printf
(albeit printf(1) but still) as a format string.  And third, there's no
way to manage line length when you're doing that.

The alternative is to put the strings in a here document.  We then cat
the result between a couple of empty echo commands to create the
original output.  This addresses all of the above issues, but creates a
new one: The info text follows the prompt, rather than the other way
around.  Not the most elegant.

So … why do this at all, why not just echo the info text outside of the
function, particularly since the function only echoes it once no matter
how many times you give a bogus answer?  Well, if at some point we
decide to implement a dialog-type interface (whiptail, zenity, whatever
you prefer), then it becomes easy to do so.  Unsure that's desirable at
this time, but options are good.
2015-10-12 02:59:42 -07:00
..