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 annotate
adds annotations to entities, including template annotations
This command adds annotations to entities. An annotation can be freeform text (-text), or structured (-template with -fields) so that values are entered in a consistent format. Structured values drive the generated "Annotations" architecture and appear as columns in annotation exports.
Use -ent to annotate one entity by unique name, or -ents to bulk annotate every entity matching a kind string.
Targets
| Option | Description |
|---|---|
-ent uniquename | Annotate the entity with the given unique name. |
-ents kindstring | Annotate every entity matching the kind string, e.g. "c file". |
Contents
| Option | Description |
|---|---|
-template id | The annotation template id. Use -templates to list them. Fields the assignments leave unset are filled from the template's defaults. |
-fields assignments | Template field values as Key=Value pairs separated by semicolons. A value with commas becomes a multi-select list. Example: "Criticality=A;Standards=DO-178C,MISRA". Values may use $parameters, expanded against each target: "Component=$FileShortName" classifies every entity by its file. |
-text text | Freeform annotation text. May be combined with -template. May use $parameters, e.g. "Review $EntityName". |
-author name | The annotation author. Defaults to the current user. |
Parameters
These $parameters may appear in -fields values, -text, and template defaults; each expands against the annotated entity: $EntityName, $EntityLongname, $EntityKind, $File, $FileShortName, $Line, $ArchName, $ProjectName, $Author, $Date, $Time. A parameter with no value for a target expands to empty text.
Other
| Option | Description |
|---|---|
-remove | Remove the target entities' annotations. With -template, only annotations using that template are removed. |
-retype id | Change the target entities' annotations from the template given with -template to this template. Values whose field key exists in the new template and remains valid carry over; the dropped fields are reported. |
-templates | List the available annotation templates and their fields. |