For my mercurial commit hook, I want to run my test cases and be asked whether I really want to commit if any of the tests fail. I'm thinking something like
<run-the-tests> || <ask-yes-no> is the way to go, except I don't know what to put in the
My best solution so far is
zenity --question, but I would like something that doesn't depend on X11. Then there's
dialog, but that depends on curses which is a no-go inside an emacs shell. So, I'm pretty stumped. How do I turn a yes-or-no user input into a zero-or-nonzero exit status?