Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
-- options.lua: process command-line options. This is a prototype!
-- This file:
--   http://angg.twu.net/dednat5/options.lua.html
--   http://angg.twu.net/dednat5/options.lua
--                    (find-dn5 "options.lua")
-- Author: Eduardo Ochs <eduardoochs@gmail.com>
-- Version: 2011apr10
-- License: GPL3
--
-- See: (find-LATEX "2011ebl-slides.tex")
--      (find-dn5 "build.lua")
--      (find-blogme4 "options.lua")

require "preamble"   -- (find-dn5 "preamble.lua")
require "process"    -- (find-dn5 "process.lua")
require "treehead"   -- (find-dn5 "treehead.lua")
require "diagforth"  -- (find-dn5 "diagforth.lua")


dooption_t = function (texfile)
    local fname_tex = texfile
    local fname = texfile:match("^(.*)%.tex$")
    if not fname then
      error(fname_tex.." does not end with .tex!\n"..
            "`-t' refuses to run.")
    end
    local fname_dnt = fname .. ".dnt"
    output = function (str) table.insert(outputs, str) end
    outputs = {preamble}
    process_fname(fname_tex)
    writefile(fname_dnt, table.concat(outputs, "\n").."\n")
    print("  "..fname_tex.." -> "..fname_dnt)
  end

dooption_e = function (luacode) assert(loadstring(luacode))() end

_O = _O or {}
_O["-t"]      = function (texfile, ...) dooption_t(texfile); dooptions(...) end
_O["-e"]      = function (luacode, ...) dooption_e(luacode); dooptions(...) end

dooptions = function (optionname, ...)
    -- PP("o", optionname, ...)
    if not    optionname  then return end
    if not _O[optionname] then
      error(format("Not in _O (for dooptions): %q", optionname))
    end
    -- PP("g", ...)
    _O[optionname](...)
  end


dooptions(...)

-- (find-dn4 "dednat4.lua" "main")
-- (find-luamanualw3m "#6" "arg =")
-- (find-dn5 "process.lua" "main-loop")






-- dump-to: tests
--[==[

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd ~/LATEX/
rm      -v 2011ebl-slides.dnt
dednat5 -t 2011ebl-slides.tex
ls      -l 2011ebl-slides.dnt

dednat5 -e "repl()"

--]==]

-- Local Variables:
-- coding:             raw-text-unix
-- ee-anchor-format:   "«%s»"
-- End: