Home
last modified time | relevance | path

Searched hist:"8 d415029e18f7364a1f05208031384fca6cade8d" (Results 1 – 1 of 1) sorted by relevance

/freebsd/stand/lua/
H A Dmenu.luadiff 8d415029e18f7364a1f05208031384fca6cade8d Tue Feb 20 04:40:16 CET 2018 Kyle Evans <kevans@FreeBSD.org> stand/lua: Extract menu handlers out into menu.handlers table

This is a bit cleaner than our former method of an if ... else chain of
handlers. Store handlers in the menu.handlers table so that they may be
added to or removed dynamically.

All handlers take the current menu and selected entry as parameters, and
their return value indicates whether the menu processor should continue or
not. An omitted return value or 'true' will indicate that we should
continue, while returning 'false' will indicate that we should exit the
current menu.

The omitted return value behavior is due to continuing the loop being the
more common situation.