Pass Arguments to a DXL Script Running Via The CLI

When running a DXL script via the command line, often the need will arise to pass arguments to the DXL script. Since there is no mechanism for this built into DOORS, another solution is needed. I think the easiest method is to define an environment variable in a batch file prior to running your DXL script.

As an example, the following line in a Windows .bat file will prompt the user to enter a value for "DOORS_ARG". This will be an environment variable defined for the duration of execution of the .bat file.

example.bat

set /p DOORS_ARG=Enter DOORS argument:

Then, in the DXL script, to read in an environment variable:

DXL

string arg1 = getenv("DOORS_ARG")