# Class: LuxiniaParam

### LuxModule: luxinialuacore

The LuxiniaParam class stores the original list of arguments with which luxinia was called. The string of the commandline execution, i.e.:

     luxinia.exe -abc test 1 -f "hello world" --word 13

will be converted in a array that is stored in a global variable named "arg", which will look like this:

     arg[1] = "luxinia.exe"
     arg[2] = "-abc"
     arg[3] = "test"
     arg[4] = "1"
     arg[5] = "-f"
     arg[6] = "hello world"
     arg[7] = "þ1þ
     arg[8] = "13"

The LuxiniaParam class also provides a set of utility functions to simplify the processing of commandline options. The arguments with which luxinia was called are put into a table that can be accessed and modified. I.e. the example above will make create a table structure that looks like this:

     env["a"] = {"test","1"}
     env["b"] = {"test","1"}
     env["c"] = {"test","1"}
     env["f"] = {"hello world"}
     env["word"] = {"13"}

You can change values in this table with the given getters and setters. Additionally, the LuxiniaParam class can help to describe the commandline options.

## Methods:

### Method overview:

- addTriggerDescription
- getArg
- getOrigArgs
- setArg
- triggerDescriptionIterator

addTriggerDescription (string trigger, string description)
  returns: ()

  Adds a trigger description to the known descriptions. The known descriptions will be listed here. If your trigger description is not listed here, please make sure that the autodocc creation is done right after you have registered the trigger.

  #### Known triggers:

  1. dbg
     This parameter will enter in debug mode when the project is being loaded.
  2. p
     requires a path argument (i.e. -p c:\project\bla). Sets the
  projectpath to the given argument and trys to execute a "main.lua" file in the given path. The path may be relative or absolute. "main.lua" is not loaded if -v for the viewer is also set.

  1. v
     launches the viewer requires 1 filename (.mtl, .prt, .f3d, .mm) optionally a second (.ma). You can combine it with setting the projectpath and resources will be loaded from there.
  2. w
     x y - sets window position
  3. h
     prints out all known module trigger descriptions
  4. d
     Writes the documentation files.
getArg (string name)
  returns: ([table])

  returns an argument table for the given triggername.

getOrigArgs ()
  returns: (table)

  returns a copy of the original arguments which is stored in a global named "arg". Since the LuxiniaParam module makes a copy of this table during startup, you must not worry about overwriting the original argument table suplied by the luxinia core.

setArg (string name, table newvalue)
  returns: ([table])

  sets a new table value for the given triggername. Pass nil to delete the triggername value.

triggerDescriptionIterator ()
  returns: (function iterator)
  returns a iterator function that can be used to list all known triggers to this moment. Use it like this:

       for index, trigger, description in LuxiniaParam.iterator() do
         print(index,trigger,description)
       end