Attached is an overhaul of John's code. Aside from some bugfixes and
readability improvements, the most significant changes are:
- Renamed functions to follow de facto and emerging Portage API naming
conventions.

- Validation of input for the list prompt and confirmation prompt functions.

- Added more terminal color codes, based on the codes from Portage's
output.py module.

- Improved handling when Portage's NOCOLOR environment var is set.

I've left some test code at the end to make it easy for everyone (and
I do mean everyone; this sucker needs a lot of testing) to try out the
various interactive prompts this eclass provides -- just run the
eclass directly and have fun. You can also run it in no color mode
thusly:

# NOCOLOR=true ./einput.eclass

If your system is already set to no color by default, you should be
able to turn on color like so:

# NOCOLOR= ./einput.eclass

Attachment: einput.eclass
Description: Binary data

Reply via email to