Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Feb 2018 17:51:33 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r329594 - head/stand/lua
Message-ID:  <201802191751.w1JHpXow045132@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Mon Feb 19 17:51:33 2018
New Revision: 329594
URL: https://svnweb.freebsd.org/changeset/base/329594

Log:
  stand/lua: Round up some more style.lua(9) concerns

Modified:
  head/stand/lua/color.lua
  head/stand/lua/config.lua
  head/stand/lua/drawer.lua
  head/stand/lua/menu.lua
  head/stand/lua/screen.lua

Modified: head/stand/lua/color.lua
==============================================================================
--- head/stand/lua/color.lua	Mon Feb 19 17:40:19 2018	(r329593)
+++ head/stand/lua/color.lua	Mon Feb 19 17:51:33 2018	(r329594)
@@ -26,10 +26,10 @@
 -- $FreeBSD$
 --
 
-local color = {};
-
 local core = require("core");
 
+local color = {};
+
 color.BLACK   = 0;
 color.RED     = 1;
 color.GREEN   = 2;
@@ -59,14 +59,14 @@ function color.escapef(c)
 	if (color.disabled) then
 		return c;
 	end
-	return "\027[3"..c.."m";
+	return "\027[3" .. c .. "m";
 end
 
 function color.escapeb(c)
 	if (color.disabled) then
 		return c;
 	end
-	return "\027[4"..c.."m";
+	return "\027[4" .. c .. "m";
 end
 
 function color.escape(fg, bg, att)
@@ -76,9 +76,9 @@ function color.escape(fg, bg, att)
 	if (not att) then
 		att = ""
 	else
-		att = att..";";
+		att = att .. ";";
 	end
-	return "\027["..att.."3"..fg..";4"..bg.."m";
+	return "\027[" .. att .. "3" .. fg .. ";4" .. bg .. "m";
 end
 
 function color.default()
@@ -92,7 +92,7 @@ function color.highlight(str)
 	if (color.disabled) then
 		return str;
 	end
-	return "\027[1m"..str.."\027[0m";
+	return "\027[1m" .. str .. "\027[0m";
 end
 
 return color;

Modified: head/stand/lua/config.lua
==============================================================================
--- head/stand/lua/config.lua	Mon Feb 19 17:40:19 2018	(r329593)
+++ head/stand/lua/config.lua	Mon Feb 19 17:51:33 2018	(r329594)
@@ -196,7 +196,7 @@ function config.loadmod(mod, silent)
 					if (not silent) then
 						print("Failed to execute '" ..
 						    v.before ..
-						    "' before loading '".. k ..
+						    "' before loading '" .. k ..
 						    "'");
 					end
 					status = false;
@@ -227,7 +227,9 @@ function config.loadmod(mod, silent)
 			end
 
 		else
-			--if not silent then print("Skiping module '".. k .. "'"); end
+			-- if not silent then
+				-- print("Skiping module '". . k .. "'");
+			-- end
 		end
 	end
 
@@ -431,4 +433,4 @@ function config.loadelf()
 end
 
 
-return config
+return config;

Modified: head/stand/lua/drawer.lua
==============================================================================
--- head/stand/lua/drawer.lua	Mon Feb 19 17:40:19 2018	(r329593)
+++ head/stand/lua/drawer.lua	Mon Feb 19 17:51:33 2018	(r329594)
@@ -193,7 +193,7 @@ function drawer.drawmenu(m)
 			else
 				name = e.name();
 			end
-			print(entry_num .. ". "..name);
+			print(entry_num .. ". " .. name);
 
 			-- fill the alias table
 			alias_table[tostring(entry_num)] = e;

Modified: head/stand/lua/menu.lua
==============================================================================
--- head/stand/lua/menu.lua	Mon Feb 19 17:40:19 2018	(r329593)
+++ head/stand/lua/menu.lua	Mon Feb 19 17:51:33 2018	(r329594)
@@ -252,7 +252,7 @@ menu.welcome = {
 				end
 				kernel_name = kernel_name .. name_color ..
 				    choice .. color.default();
-				return color.highlight("K").."ernel: " ..
+				return color.highlight("K") .. "ernel: " ..
 				    kernel_name .. " (" .. idx .. " of " ..
 				    #all_choices .. ")";
 			end,
@@ -315,7 +315,7 @@ function menu.run(m)
 		-- Special key behaviors
 		if ((key == core.KEY_BACKSPACE) or (key == core.KEY_DELETE)) and
 		    (m ~= menu.welcome) then
-			break
+			break;
 		elseif (key == core.KEY_ENTER) then
 			core.boot();
 			-- Should not return
@@ -431,7 +431,7 @@ function menu.autoboot()
 		end
 
 		loader.delay(50000);
-	until time <= 0
+	until time <= 0;
 	core.boot();
 
 end

Modified: head/stand/lua/screen.lua
==============================================================================
--- head/stand/lua/screen.lua	Mon Feb 19 17:40:19 2018	(r329593)
+++ head/stand/lua/screen.lua	Mon Feb 19 17:51:33 2018	(r329594)
@@ -26,11 +26,11 @@
 -- $FreeBSD$
 --
 
-local screen = {};
-
 local color = require("color");
 local core = require("core");
 
+local screen = {};
+
 -- XXX TODO: This should be fixed in the interpreter to not print decimals
 function intstring(num)
 	local str = tostring(num);
@@ -54,21 +54,21 @@ function screen.setcursor(x, y)
 		return;
 	end
 
-	loader.printc("\027["..intstring(y)..";"..intstring(x).."H");
+	loader.printc("\027[" .. intstring(y) .. ";" .. intstring(x) .. "H");
 end
 
 function screen.setforeground(c)
 	if (color.disabled) then
 		return c;
 	end
-	loader.printc("\027[3"..c.."m");
+	loader.printc("\027[3" .. c .. "m");
 end
 
 function screen.setbackground(c)
 	if (color.disabled) then
 		return c;
 	end
-	loader.printc("\027[4"..c.."m");
+	loader.printc("\027[4" .. c .. "m");
 end
 
 function screen.defcolor()



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802191751.w1JHpXow045132>