summaryrefslogtreecommitdiff
path: root/scripts/context/lua/mtx-watch.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2009-05-28 11:23:00 +0200
committerHans Hagen <pragma@wxs.nl>2009-05-28 11:23:00 +0200
commit1d3090326210c6e6f7ec5432799ded25b75bba46 (patch)
treec5921203789ec669e6bccaba4bd56f9c072dc56b /scripts/context/lua/mtx-watch.lua
parent94d83f84758766511c5e324721e39fea6ab71dae (diff)
downloadcontext-1d3090326210c6e6f7ec5432799ded25b75bba46.tar.gz
beta 2009.05.28 11:23
Diffstat (limited to 'scripts/context/lua/mtx-watch.lua')
-rw-r--r--scripts/context/lua/mtx-watch.lua24
1 files changed, 18 insertions, 6 deletions
diff --git a/scripts/context/lua/mtx-watch.lua b/scripts/context/lua/mtx-watch.lua
index b7b6fb77b..2e4dcf6ef 100644
--- a/scripts/context/lua/mtx-watch.lua
+++ b/scripts/context/lua/mtx-watch.lua
@@ -58,6 +58,20 @@ do
end
end
end
+ local function toset(t)
+ if type(t) == "table" then
+ return table.concat(t,",")
+ else
+ return t
+ end
+ end
+ local function noset(t)
+ if type(t) == "table" then
+ return t[1]
+ else
+ return t
+ end
+ end
local function process()
local done = false
for _, path in ipairs(environment.files) do
@@ -77,8 +91,8 @@ do
local command = joblog.command
if command then
local replacements = {
- inputpath = (joblog.paths and joblog.paths.input ) or ".",
- outputpath = (joblog.paths and joblog.paths.output) or ".",
+ inputpath = toset((joblog.paths and joblog.paths.input ) or "."),
+ outputpath = noset((joblog.paths and joblog.paths.output) or "."),
filename = joblog.filename or "",
}
command = command:gsub("%%(.-)%%", replacements)
@@ -225,7 +239,7 @@ function scripts.watch.show_logs(path) -- removes duplicates
end
end
-banner = banner .. " | watchdog"
+logs.extendbanner("Watchdog 1.00",true)
messages.help = [[
--logpath optional path for log files
@@ -236,8 +250,6 @@ messages.help = [[
--showlog show log data
]]
-input.verbose = true
-
if environment.argument("watch") then
scripts.watch.watch()
elseif environment.argument("collect") then
@@ -245,5 +257,5 @@ elseif environment.argument("collect") then
elseif environment.argument("showlog") then
scripts.watch.show_logs()
else
- input.help(banner,messages.help)
+ logs.help(messages.help)
end