webmcp
changeset 294:0a6378afc6da
Documentations of global constants
author | jbe |
---|---|
date | Sun Mar 22 17:33:37 2015 +0100 (2015-03-22) |
parents | 81d94b362043 |
children | 1fbdccf4f8e9 |
files | Makefile framework/bin/mcp.lua |
line diff
1.1 --- a/Makefile Sun Mar 22 17:17:22 2015 +0100 1.2 +++ b/Makefile Sun Mar 22 17:33:37 2015 +0100 1.3 @@ -9,7 +9,7 @@ 1.4 1.5 documentation:: 1.6 rm -f doc/autodoc.tmp 1.7 - $(LUA_BIN) framework/bin/autodoc.lua framework/env/ libraries/ > doc/autodoc.tmp 1.8 + $(LUA_BIN) framework/bin/autodoc.lua framework/bin/mcp.lua framework/env/ libraries/ > doc/autodoc.tmp 1.9 cat doc/autodoc-header.htmlpart doc/autodoc.tmp doc/autodoc-footer.htmlpart > doc/autodoc.html 1.10 rm -f doc/autodoc.tmp 1.11
2.1 --- a/framework/bin/mcp.lua Sun Mar 22 17:17:22 2015 +0100 2.2 +++ b/framework/bin/mcp.lua Sun Mar 22 17:33:37 2015 +0100 2.3 @@ -1,6 +1,12 @@ 2.4 #!/usr/bin/env moonbridge 2.5 2.6 +--[[-- 2.7 +WEBMCP_VERSION 2.8 + 2.9 +A string containing the WebMCP version, e.g. "2.0.0" 2.10 +--]]-- 2.11 WEBMCP_VERSION = "2.0.0" 2.12 +--//-- 2.13 2.14 -- allow control of global environment 2.15 local _G = _G 2.16 @@ -13,15 +19,51 @@ 2.17 } 2.18 _ENV = setmetatable({}, global_metatable) 2.19 2.20 +--[[-- 2.21 +WEBMCP_MODE 2.22 + 2.23 +A constant set to "listen" in case of a network request, or set to "interactive" in case of interactive mode. 2.24 +--]]-- 2.25 -- check if interactive mode 2.26 if listen then -- defined by moonbridge 2.27 WEBMCP_MODE = "listen" 2.28 else 2.29 WEBMCP_MODE = "interactive" 2.30 end 2.31 +--//-- 2.32 2.33 --- configuration names are provided as 4th, 5th, etc. argument 2.34 +--[[-- 2.35 +WEBMCP_CONFIG_NAMES 2.36 + 2.37 +A list of the selected configuration names. 2.38 +--]]-- 2.39 +-- configuration names are provided as 4th, 5th, etc. command line argument 2.40 WEBMCP_CONFIG_NAMES = {select(4, ...)} 2.41 +--//-- 2.42 + 2.43 +--[[-- 2.44 +WEBMCP_FRAMEWORK_PATH 2.45 + 2.46 +Directory of the WebMCP framework (always includes a trailing slash). 2.47 +--]]-- 2.48 +-- set in mcp.lua 2.49 +--//-- 2.50 + 2.51 +--[[-- 2.52 +WEBMCP_BASE_PATH 2.53 + 2.54 +Base directory of the application (always includes a trailing slash). 2.55 +--]]-- 2.56 +-- set in mcp.lua 2.57 +--//-- 2.58 + 2.59 +--[[-- 2.60 +WEBMCP_APP_NAME 2.61 + 2.62 +Application name (usually "main"). May be nil in case of interactive mode. 2.63 +--]]-- 2.64 +-- set in mcp.lua 2.65 +--//-- 2.66 2.67 -- determine framework and bath path from command line arguments 2.68 -- or print usage synopsis (if applicable)