mirror of
				https://github.com/SquidDev-CC/CC-Tweaked
				synced 2025-10-31 13:42:59 +00:00 
			
		
		
		
	Make Lua's "exit" function a little prettier
"exit" now has a custom __tostring method, which prints an explanation
message. This is very similar to how Python achives the same
functionality:
    lua> exit
    Call exit() to exit
    lua> exit()
    > Actually leaves the REPL
			
			
This commit is contained in:
		| @@ -9,9 +9,10 @@ end | ||||
| local bRunning = true | ||||
| local tCommandHistory = {} | ||||
| local tEnv = { | ||||
|     ["exit"] = function() | ||||
|         bRunning = false | ||||
|     end, | ||||
|     ["exit"] = setmetatable({}, { | ||||
|         __tostring = function() return "Call exit() to exit" end, | ||||
|         __call = function() bRunning = false end, | ||||
|     }), | ||||
|     ["_echo"] = function( ... ) | ||||
|         return ... | ||||
|     end, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 SquidDev
					SquidDev