6 print("Usage: " .. arg[0] .. " [options]")
8 print(" -a: apply the config changes")
9 print(" -t: show matching UCI triggers")
10 print(" -s: show information about tasks to be executed")
11 print(" -r: reset all triggers")
12 print(" -C <trigger> [<section>]: force clear a trigger")
13 print(" -S <trigger> [<section>]: force set a trigger")
17 if arg[1] == "-s" then
18 local triggers = uci.trigger.get_active()
21 for i, a in ipairs(triggers) do
24 print(" - " .. uci.trigger.get_description(trigger, sections))
29 elseif arg[1] == "-t" then
30 local triggers = uci.trigger.get_active()
31 for i, a in ipairs(triggers) do
34 if trigger.section_only then
35 print(trigger.id .. " " .. table.concat(" ", sections))
40 elseif arg[1] == "-a" then
42 elseif arg[1] == "-r" then
43 uci.trigger.reset_state()
44 elseif arg[1] == "-S" then
45 local trigger = arg[2]
46 local section = arg[3]
47 uci.trigger.set_active(trigger, section)
48 elseif arg[1] == "-C" then
49 local trigger = arg[2]
50 local section = arg[3]
51 uci.trigger.clear_active(trigger, section)