und is the command-line interface to Understand — script project creation, analysis, CodeCheck, metrics, and reports, locally or in CI.
Run Understand from the command line · Headless workflow: create, analyze, check, report
und list
lists information about the project
The list command takes in one argument: the thing to list. There are five different arguments available:
1) Files
This lists all the files in the project. It is run like this.
und list files myProject.und
It has one switch, -tree. The switch causes the files to be displayed in a tree instead of in a list. It could look like this.
und list -tree files myProject.und
2) Arches
This lists all the custom architectures in the project. It has no switches and could be run like this.
und list arches myProject.und
3) Roots
This lists all the named roots in the project. It has two available switches.
| Option | Description |
|---|---|
-unmapped | List files with an undefined named root. |
-unportable | List files that are not portable. |
The command could be run like this.
und list -unmapped -unportable roots myProject.und
4) Baselines
This lists the baselines set for the project in three columns: the configuration, the start date and time, and the id. It has no switches and could be run like this.
und list baselines myProject.und
5) Settings
By itself, this command will list the general settings of the project (languages, file types, file options). It also has switches available for specific settings. They are:
| Option | Description |
|---|---|
-all | List all the settings for the project. |
-metrics | List the metric settings and show available metrics. -metric is accepted as an alias. |
-reports | List the report settings and show available reports. -report is accepted as an alias. |
-import | List import (cmake, visual studio, etc) files and options. |
-lang | List all the language specific settings. It can take in a particular language to show the the settings for, or if no parameter is given, it will show the settings for all project languages. |
-override | List the overrides for a particular file or directory. It takes as a parameter a list of files or directories to print the overrides for. It accepts a text file listing one file or directory per line, comments starting with #. |
-terse | Displays only the yes/no options with no lists. |
-macros | List only the macros for the languages given with -lang switch instead of all language settings. If the -lang switch is not given, all project macros are listed. |
-includes | List only the includes for the languages given with -lang switch instead of all language settings. If the -lang switch is not given, all project includes are listed. This can appear with the -macro switch so includes and macros are listed. |
The command could look like this.
und -db myProject.und list -override file1.cpp file2.java settings
und list -override @listfile.txt myProject.und
list -metrics -reports settings (Interactive Mode)
list -all settings (Interactive Mode)
list -lang C++ fortran -macros -includes settings
list -lang C++ settings (Interactive Mode)