stand/lua: Menu style.lua(9) nits

This commit is contained in:
Kyle Evans 2018-02-19 15:47:09 +00:00
parent b140d14b02
commit 57099121d5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=329578

View File

@ -52,7 +52,8 @@ menu.boot_options = {
{ {
entry_type = core.MENU_RETURN, entry_type = core.MENU_RETURN,
name = function() name = function()
return "Back to main menu"..color.highlight(" [Backspace]"); return "Back to main menu" ..
color.highlight(" [Backspace]");
end end
}, },
@ -60,7 +61,8 @@ menu.boot_options = {
{ {
entry_type = core.MENU_ENTRY, entry_type = core.MENU_ENTRY,
name = function() name = function()
return "Load System "..color.highlight("D").."efaults"; return "Load System " .. color.highlight("D") ..
"efaults";
end, end,
func = function() func = function()
core.setDefaults(); core.setDefaults();
@ -86,7 +88,8 @@ menu.boot_options = {
{ {
entry_type = core.MENU_ENTRY, entry_type = core.MENU_ENTRY,
name = function() name = function()
return OnOff(color.highlight("A").."CPI :", core.acpi); return OnOff(color.highlight("A") .. "CPI :",
core.acpi);
end, end,
func = function() func = function()
core.setACPI(); core.setACPI();
@ -97,7 +100,8 @@ menu.boot_options = {
{ {
entry_type = core.MENU_ENTRY, entry_type = core.MENU_ENTRY,
name = function() name = function()
return OnOff("Safe "..color.highlight("M").."ode :", core.sm); return OnOff("Safe " .. color.highlight("M") ..
"ode :", core.sm);
end, end,
func = function() func = function()
core.setSafeMode(); core.setSafeMode();
@ -108,7 +112,8 @@ menu.boot_options = {
{ {
entry_type = core.MENU_ENTRY, entry_type = core.MENU_ENTRY,
name = function() name = function()
return OnOff(color.highlight("S").."ingle user:", core.su); return OnOff(color.highlight("S") .. "ingle user:",
core.su);
end, end,
func = function() func = function()
core.setSingleUser(); core.setSingleUser();
@ -119,7 +124,8 @@ menu.boot_options = {
{ {
entry_type = core.MENU_ENTRY, entry_type = core.MENU_ENTRY,
name = function() name = function()
return OnOff(color.highlight("V").."erbose :", core.verbose); return OnOff(color.highlight("V") .. "erbose :",
core.verbose);
end, end,
func = function() func = function()
core.setVerbose(); core.setVerbose();
@ -133,7 +139,8 @@ menu.welcome = {
{ {
entry_type = core.MENU_ENTRY, entry_type = core.MENU_ENTRY,
name = function() name = function()
return color.highlight("B").."oot Multi user "..color.highlight("[Enter]"); return color.highlight("B") .. "oot Multi user " ..
color.highlight("[Enter]");
end, end,
func = function() func = function()
core.setSingleUser(false); core.setSingleUser(false);
@ -146,7 +153,7 @@ menu.welcome = {
{ {
entry_type = core.MENU_ENTRY, entry_type = core.MENU_ENTRY,
name = function() name = function()
return "Boot "..color.highlight("S").."ingle user"; return "Boot " .. color.highlight("S") .. "ingle user";
end, end,
func = function() func = function()
core.setSingleUser(true); core.setSingleUser(true);
@ -159,7 +166,7 @@ menu.welcome = {
{ {
entry_type = core.MENU_RETURN, entry_type = core.MENU_RETURN,
name = function() name = function()
return color.highlight("Esc").."ape to loader prompt"; return color.highlight("Esc") .. "ape to loader prompt";
end, end,
func = function() func = function()
loader.setenv("autoboot_delay", "NO"); loader.setenv("autoboot_delay", "NO");
@ -171,7 +178,7 @@ menu.welcome = {
{ {
entry_type = core.MENU_ENTRY, entry_type = core.MENU_ENTRY,
name = function() name = function()
return color.highlight("R").."eboot"; return color.highlight("R") .. "eboot";
end, end,
func = function() func = function()
loader.perform("reboot"); loader.perform("reboot");
@ -229,7 +236,7 @@ menu.welcome = {
{ {
entry_type = core.MENU_SUBMENU, entry_type = core.MENU_SUBMENU,
name = function() name = function()
return "Boot "..color.highlight("O").."ptions"; return "Boot " .. color.highlight("O") .. "ptions";
end, end,
submenu = function() submenu = function()
return menu.boot_options; return menu.boot_options;
@ -338,7 +345,7 @@ function menu.run(m)
end end
function menu.skip() function menu.skip()
if (core.isSerialBoot())then if (core.isSerialBoot()) then
return true; return true;
end end
local c = string.lower(loader.getenv("console") or ""); local c = string.lower(loader.getenv("console") or "");
@ -374,8 +381,9 @@ function menu.autoboot()
repeat repeat
time = endtime - loader.time(); time = endtime - loader.time();
screen.setcursor(x, y); screen.setcursor(x, y);
print("Autoboot in "..time.." seconds, hit [Enter] to boot" print("Autoboot in " .. time ..
.." or any other key to stop "); " seconds, hit [Enter] to boot" ..
" or any other key to stop ");
screen.defcursor(); screen.defcursor();
if (io.ischar()) then if (io.ischar()) then
local ch = io.getchar(); local ch = io.getchar();
@ -385,7 +393,7 @@ function menu.autoboot()
-- erase autoboot msg -- erase autoboot msg
screen.setcursor(0, y); screen.setcursor(0, y);
print(" " print(" "
.." "); .. " ");
screen.defcursor(); screen.defcursor();
return; return;
end end
@ -399,9 +407,11 @@ end
function OnOff(str, b) function OnOff(str, b)
if (b) then if (b) then
return str .. color.escapef(color.GREEN).."On"..color.escapef(color.WHITE); return str .. color.escapef(color.GREEN) .. "On" ..
color.escapef(color.WHITE);
else else
return str .. color.escapef(color.RED).."off"..color.escapef(color.WHITE); return str .. color.escapef(color.RED) .. "off" ..
color.escapef(color.WHITE);
end end
end end