Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Mar 2018 03:21:12 +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: r330369 - head/stand/lua
Message-ID:  <201803040321.w243LCnU040003@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Sun Mar  4 03:21:12 2018
New Revision: 330369
URL: https://svnweb.freebsd.org/changeset/base/330369

Log:
  lualoader: Return meaningful value in cli_execute
  
  loader.command(...) will return whatever the executed function returns, so
  follow suit and return whatever loader.command() returned or whatever the
  Lua function returns.

Modified:
  head/stand/lua/cli.lua

Modified: head/stand/lua/cli.lua
==============================================================================
--- head/stand/lua/cli.lua	Sun Mar  4 03:13:13 2018	(r330368)
+++ head/stand/lua/cli.lua	Sun Mar  4 03:21:12 2018	(r330369)
@@ -77,8 +77,7 @@ function cli_execute(...)
 	local argv = {...}
 	-- Just in case...
 	if #argv == 0 then
-		loader.command(...)
-		return
+		return loader.command(...)
 	end
 
 	local cmd_name = argv[1]
@@ -88,9 +87,9 @@ function cli_execute(...)
 		-- traditional reasons for including it don't necessarily apply,
 		-- it may not be totally redundant if we want to have one global
 		-- handling multiple commands
-		cmd(...)
+		return cmd(...)
 	else
-		loader.command(...)
+		return loader.command(...)
 	end
 
 end



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