Lines Matching +full:ch +full:- +full:func

1 --
2 -- SPDX-License-Identifier: BSD-2-Clause
3 --
4 -- Copyright (c) 2015 Pedro Souza <pedrosouza@freebsd.org>
5 -- Copyright (c) 2018 Kyle Evans <kevans@FreeBSD.org>
6 -- All rights reserved.
7 --
8 -- Redistribution and use in source and binary forms, with or without
9 -- modification, are permitted provided that the following conditions
10 -- are met:
11 -- 1. Redistributions of source code must retain the above copyright
12 -- notice, this list of conditions and the following disclaimer.
13 -- 2. Redistributions in binary form must reproduce the above copyright
14 -- notice, this list of conditions and the following disclaimer in the
15 -- documentation and/or other materials provided with the distribution.
16 --
17 -- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18 -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 -- ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21 -- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 -- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 -- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 -- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 -- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 -- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 -- SUCH DAMAGE.
28 --
68 -- Module exports
70 -- Menu handlers take the current menu and selected entry as parameters,
71 -- and should return a boolean indicating whether execution should
72 -- continue or not. The return value may be omitted if this entry should
73 -- have no bearing on whether we continue or not, indicating that we
74 -- should just continue after execution.
76 -- run function
77 entry.func()
80 -- carousel (rotating) functionality
90 entry.func(caridx, choices[caridx], choices)
97 -- allow entry to have a function/side effect
98 if entry.func ~= nil then
99 entry.func()
104 -- loader menu tree is rooted at menu.welcome
108 -- return to welcome menu
133 func = function(_, choice, _) function
147 func = function() function
148 -- Reset active boot environment to the default
159 -- return to welcome menu
161 -- load defaults
166 func = core.setDefaults,
176 -- acpi
184 func = core.setACPI,
187 -- safe mode
194 func = core.setSafeMode,
197 -- single user
204 func = core.setSingleUser,
207 -- verbose boot
214 func = core.setVerbose,
227 -- Swap the first two menu items on single user boot.
228 -- We'll cache the alternate entries for performance.
287 -- Not a standard menu entry function!
292 func = function() function
301 -- Not a standard menu entry function!
304 func = function() function
315 func = function() function
323 func = function() function
331 func = function() function
357 func = function(_, choice, _) function
381 func = function() function
413 func = function() function
441 -- current_alias_table will be used to keep our alias table consistent across
442 -- screen redraws, instead of relying on whatever triggered the redraw to update
443 -- the local alias_table in menu.process.
447 -- Clear the screen, reset the cursor, then draw
454 -- 'keypress' allows the caller to indicate that a key has been pressed that we
455 -- should process as our initial input.
467 -- Special key behaviors
473 -- Should not return. If it does, escape menu handling
474 -- and drop to loader prompt.
479 -- check to see if key is an alias
488 -- if we have an alias do the assigned action:
492 -- The handler's return value indicates if we
493 -- need to exit this menu. An omitted or true
494 -- return value means to continue.
498 -- If we got an alias key the screen is out of date...
499 -- redraw it.
515 if delay == -1 then
525 -- autoboot_key should return the key pressed. It will only
526 -- return nil if we hit the timeout and executed the timeout
527 -- command. Bail out.
537 -- We explicitly want the newline print adds
549 time = endtime - loader.time()
560 local ch = io.getchar()
561 if ch == core.KEY_ENTER then
564 -- Erase autoboot msg. While real VT100s
565 -- wouldn't scroll when receiving a char with
566 -- the cursor at (79, 24), bad emulators do.
567 -- Avoid the issue by stopping at 79.
571 return ch
583 -- CLI commands