[NTG-context] How to store command line arguments in ConTeXt LUA Documents?

Romain Diss romain.diss at yahoo.fr
Mon Mar 14 22:46:57 CET 2016


> >Is it possible to store context command line arguments into lua
> >variables?
> > [...]
> >What I would like to do is something like this:
> >
> >-- start of the example
> >something = context.getcommandlineargument("ARG1") -- doesn't exist
> >-- make some tests here to check if 'something' has the right syntax
> >context.startdocument{title = something}
> >context.input("knuth")
> >context.stopdocument()
> >-- end of the example
> >
> >Then, one has just to launch:
> >$ context file.cld --ARG1="My first title"
> 
> environment.arguments
Thank you. It works very well.

I did not find this table in any documentation. Did I forget something?

If I want to document it, what is the best place?
- http://wiki.contextgarden.net/Command/getdocumentargument
- another place in the wiki which evokes lua environment tables...


All the best.


-- 
Romain Diss


More information about the ntg-context mailing list