emerge: Implement "--alert"

Implement "--alert" (short option "-A"), which adds a terminal bell
character ('\a') to all prompts, when it is set to True or "y". It may
be used without an option, like e.g. --ask, to mean True.

The patch refactors userquery to a class, UserQuery, to accommodate
--alert. It also adds the option to the emerge man page.

A quick example is to do 'emerge -PAc portage'.

If you have your terminal emulator set up to make '\a' into a window
manager urgency hint, move your cursor to a different window to get the
effect. 'sleep 2 && emerge' is another way to test this.

The --alert option is especially useful if you, like me, tend to fire up
a big world update when you get to the office in the morning (or night),
and then immediately change your focus to something else. If you now do
'emerge -auAD world', emerge will courteously point out when it has
finished calculating the graph, and again when it has finished emerging.

Signed-off-by: Alexander Berntsen <bernalex@gentoo.org>
7 files changed