scitools.com

← All und commands

und is the command-line interface to Understand — script project creation, analysis, CodeCheck, metrics, and reports, locally or in CI.

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

OptionDescription
-ent uniquenameAnnotate the entity with the given unique name.
-ents kindstringAnnotate every entity matching the kind string, e.g. "c file".

Contents

OptionDescription
-template idThe annotation template id. Use -templates to list them. Fields the assignments leave unset are filled from the template's defaults.
-fields assignmentsTemplate 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 textFreeform annotation text. May be combined with -template. May use $parameters, e.g. "Review $EntityName".
-author nameThe 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

OptionDescription
-removeRemove the target entities' annotations. With -template, only annotations using that template are removed.
-retype idChange 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.
-templatesList the available annotation templates and their fields.