# HG changeset patch # User jbe # Date 1427042017 -3600 # Node ID 0a6378afc6daa11c716c9777149599ff777ff97f # Parent 81d94b362043af9e7699e3a15fefe39e8ff5d49b Documentations of global constants diff -r 81d94b362043 -r 0a6378afc6da Makefile --- a/Makefile Sun Mar 22 17:17:22 2015 +0100 +++ b/Makefile Sun Mar 22 17:33:37 2015 +0100 @@ -9,7 +9,7 @@ documentation:: rm -f doc/autodoc.tmp - $(LUA_BIN) framework/bin/autodoc.lua framework/env/ libraries/ > doc/autodoc.tmp + $(LUA_BIN) framework/bin/autodoc.lua framework/bin/mcp.lua framework/env/ libraries/ > doc/autodoc.tmp cat doc/autodoc-header.htmlpart doc/autodoc.tmp doc/autodoc-footer.htmlpart > doc/autodoc.html rm -f doc/autodoc.tmp diff -r 81d94b362043 -r 0a6378afc6da framework/bin/mcp.lua --- a/framework/bin/mcp.lua Sun Mar 22 17:17:22 2015 +0100 +++ b/framework/bin/mcp.lua Sun Mar 22 17:33:37 2015 +0100 @@ -1,6 +1,12 @@ #!/usr/bin/env moonbridge +--[[-- +WEBMCP_VERSION + +A string containing the WebMCP version, e.g. "2.0.0" +--]]-- WEBMCP_VERSION = "2.0.0" +--//-- -- allow control of global environment local _G = _G @@ -13,15 +19,51 @@ } _ENV = setmetatable({}, global_metatable) +--[[-- +WEBMCP_MODE + +A constant set to "listen" in case of a network request, or set to "interactive" in case of interactive mode. +--]]-- -- check if interactive mode if listen then -- defined by moonbridge WEBMCP_MODE = "listen" else WEBMCP_MODE = "interactive" end +--//-- --- configuration names are provided as 4th, 5th, etc. argument +--[[-- +WEBMCP_CONFIG_NAMES + +A list of the selected configuration names. +--]]-- +-- configuration names are provided as 4th, 5th, etc. command line argument WEBMCP_CONFIG_NAMES = {select(4, ...)} +--//-- + +--[[-- +WEBMCP_FRAMEWORK_PATH + +Directory of the WebMCP framework (always includes a trailing slash). +--]]-- +-- set in mcp.lua +--//-- + +--[[-- +WEBMCP_BASE_PATH + +Base directory of the application (always includes a trailing slash). +--]]-- +-- set in mcp.lua +--//-- + +--[[-- +WEBMCP_APP_NAME + +Application name (usually "main"). May be nil in case of interactive mode. +--]]-- +-- set in mcp.lua +--//-- -- determine framework and bath path from command line arguments -- or print usage synopsis (if applicable)