From owner-svn-src-head@freebsd.org Mon Feb 19 17:51:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FEE4F15374; Mon, 19 Feb 2018 17:51:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 435C282718; Mon, 19 Feb 2018 17:51:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E5A21DD38; Mon, 19 Feb 2018 17:51:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1JHpYJn045137; Mon, 19 Feb 2018 17:51:34 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1JHpXow045132; Mon, 19 Feb 2018 17:51:33 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802191751.w1JHpXow045132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 19 Feb 2018 17:51:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329594 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329594 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Feb 2018 17:51:34 -0000 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()