Command Line Processing |
A project database file (.udc) is created when a project is configured and analyzed using either the graphical interface of Understand for C++ or the command line tool "undc".
The "undc" command line takes this form:
undc [-db] db [files] [Options]Refer to the following sections for details on all the available command line options and how to create and analyze a project.
The only required argument for all commands using "undc" is the project database file.
Following are the optional command line options for "undc".
Refer to the following sections for examples on using "undc" to create and analyze a project.
There are several ways to create a new project file using "undc". Of course you can use the graphical interface of Understand for C++ to first create your project, but here we will examine a few ways to do it from the command line.
To create a new, empty, project called sample.udc:
undc -create -db sample.udcThen you may add files to the project. To add all .c and .h files in the current directory to your project:
undc -db sample.udc -add *.c *.hOr you can create a text file listing all your source files (one file per line) and use that file to load your project. Entries in the list.txt file may look something like this:
c:\sti\sample\understand_c\fastgrep\egrep.cThen reference the file to add those source files to your project:
undc -db sample.udc -add @list.txtAlternatively, you can create and add files to the database all in one command. For example:
undc -db sample.udc -create -add *.c *.hWhatever way you choose to create your project database, you are now ready to analyze that project.
The "undc" command line program allows you to analyze (or re-analyze) a previously created project database. Refer to the preceding section if you haven't yet created and configured your project.
When analyzing a project, you have two options to choose from. You may re-analyze all files with the -rebuild option, or only those files that have changed with the -refresh option.
If you are doing your first analysis after creating a new project, it doesn't matter which option you choose as it will parse all files regardless. However, if you are performing this function on a regular basis, you may prefer to do an incremental analysis where only the modified files and any other files dependent on those files are re-analyzed.
For example. parse all files in the project with the following command:
undc sample.udc -rebuildOr, to perform an incremental analysis, re-parsing only those files that have changed or other dependent files, use the command:
undc sample.udc -refreshScientific Toolworks, Inc. http://www.scitools.com Voice: (802) 763-2995 Fax: (802) 763-3066 support@scitools.com sales@scitools.com |