![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: How do I get command line arguments in batch mode? Topic Summary: Created On: 22-Jun-2004 15:54 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: As far as I know you cannot pass parameters such that the DXL will read them and then act on them. You can only pass command line switches from the manual, and yes "-p" project is one of them. The -p project parameter is an artifact from DOORS v4 where you HAD to log into a project (rather than log into the database); and in v5 it didn't work as expected when I feebly practiced with it (IIRC the project gets locked but not opened). Write a simple batch file that prints the name of the current project, then fire it up from DOS window using -p; just to see if it works. As for parameters, you could try this: DOS *.bat file: set MyParameter = MyValue doors.exe -dxl MyDXL.dxl MyDXL.dxl: string Parameter = getenv("MyParameter") print "MyParameter = '" Parameter "'\n" - Louie | |
![]() |
|
Howdy,
I'm trying to write a report script that can extract metrics from any named project. I'd like to specify the project name as a command line parameter in batch mode, something like: doors -batch count_vowels.dxl arg1 arg2 (where arg1 and arg2 would be the args I want to pass in, naturally.) I cannot see a way in the DXL reference to get this information. The closest thing I can see is the -D/-dxl switch, for passing executable code. Am I missing something, or do I have to use -dxl for feeding in argument data? =Austin |
|
![]() |
|
![]() |
|
Hi Austin,
if You only want to pass the Project name, You can use commandline switch : -project (-p) project_name The name of the project that you want to open at the start of the session. The contents of the project are displayed in the right pane of the DOORS Explorer. If you use the -batch switch, the parameter specifies the current project. as described in the DOORS help file .... ;-)) If You want to pass other parameters, You could use a file or registry(Windows)/Environment variables(UNIX) A file can be read into a string with string foo = readFile "fileName". The environment varibles can be accessed by using : string foo = getenv "variableName". Another easier possebility could be the -dxl (-D) commandline switch : doors -D "string foo1 = \"bla\";int foo2= 5" -u user -P password -b fileName.dxl" In the DXL script fileName.dxl You can use foo1 and foo2 ... I hope this will help You greetings Reik Schröder Siemens AG Berlin ------------------------- Evosoft GmbH for Siemens Industry Sector Berlin, Germany |
|
![]() |
|
![]() |
|
As far as I know you cannot pass parameters such that the DXL will read them and then act on them. You can only pass command line switches from the manual, and yes "-p" project is one of them.
The -p project parameter is an artifact from DOORS v4 where you HAD to log into a project (rather than log into the database); and in v5 it didn't work as expected when I feebly practiced with it (IIRC the project gets locked but not opened). Write a simple batch file that prints the name of the current project, then fire it up from DOS window using -p; just to see if it works. As for parameters, you could try this: DOS *.bat file: set MyParameter = MyValue doors.exe -dxl MyDXL.dxl MyDXL.dxl: string Parameter = getenv("MyParameter") print "MyParameter = '" Parameter "'\n" - Louie |
|
![]() |
|
![]() |
|
Reik, Louie,
Thanks for the feedback. I confirms what I've discovered over the last day. As of v7.1, the -dxl option is non-viable: while you can do something like this: doors -b script.dxl -dxl "int foo=0;" It doesn't serve well in the general case because there is no effective way to handle a case where the variable is *not* defined via -dxl -- there's no good way to set a default value. After experimenting, I've decided to use environment variables -- there's less hassle with OS switching, and it does just about everything I need it to do. Thanks again for the help, guys. =Austin |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.