Command line interface
DDD is a plain command line tool: it reads json files, writes files or a report, and exits,
and everything a build or a delivery needs from it happens in one such run. That is what
makes it usable from wherever the build already lives - a makefile, a cmake project (see
Build integration), a batch file on an engineer’s machine, or a ci job that never sees
a terminal. Two commands do not exit: ddd lsp, the language server an editor keeps running
(see Editor integration), and ddd gui, the preview of a browser interface, which
serves until it is interrupted. The one file the tool leaves behind for its own use is the
ddd-build.json that ddd build-info writes for the language server and for ddd gui,
which both apply the severities of the build that names a project.
The same discipline governs the output. The findings - everything the tool has to say about
a project - are written to standard error, one line per finding followed by a summary, while
what a command actually produces (a listing, the dumped dictionary, a json schema, the list
of source files) goes to standard output. The two never mix, so
nothing has to be filtered out of a redirection: ddd dump project.ddd.json >
baseline.json archives the dictionary and nothing else, even on a run that had something to
say about it.
For a job that files findings rather than reads them, nine commands understand
--format json: check, compare, generate, list, dump, sources,
artefacts, checks and tool. That leaves out schema and build-info, whose
output is json already, lsp, which speaks json-rpc, gui, which serves pages to a
browser, cmake-dir and templates-dir, which print one path, and id, which reports
the files it skipped and one total rather than findings. In json the diagnostics become part
of the document the command prints, next to whatever else it has to report:
$ ddd generate all examples/demo/demo.ddd.json -o build/gen -t examples/templates --format json
{
"diagnostics": [],
"summary": {
"error": 0,
"warning": 0,
"info": 0
},
"generated": [
{
"path": "build/gen/ddd_globals.c",
"status": "created"
},
{
"path": "build/gen/ddd_globals.h",
"status": "created"
},
...
{
"path": "build/gen/DemoDevice.a2l",
"status": "created"
}
]
}
The one exception is ddd dump, whose standard output is itself the payload: there the json
diagnostics go to standard error, so that both formats leave the dictionary alone. Given
-o, the dictionary goes into that file instead and standard output stays empty; the
diagnostics stay where they were, and in json they name the file written, with its status,
under the same generated key generate uses:
$ ddd dump examples/demo/demo.ddd.json -o build/dump/demo.json --format json
{
"diagnostics": [],
"summary": {
"error": 0,
"warning": 0,
"info": 0
},
"generated": [
{
"path": "build/dump/demo.json",
"status": "created"
}
]
}
A path is spelled as the run was asked for it - relative when -o was relative - and a
status is created, updated, unchanged or, for a file an earlier generate
wrote into its output directory and this run no longer writes, removed (see
What a run owns).
ddd list --format json answers with the project, its components and one row per variable
beside the diagnostics. A row is the record the data dictionary
carries for that object, so the rows come in two shapes: a member of a structured variable
carries path, instance and instance_id where a plain object carries id. Every
row of either shape opens with name - a member’s being its access path - so one key
answers what a row is about:
$ ddd list examples/demo/demo.ddd.json --format json
{
"project": "DemoDevice",
"components": [
...
"variables": [
{
"name": "AxisA",
...
"name": "Diagnosis.faults",
"path": "Diagnosis.faults",
"instance": "Diagnosis",
...
"diagnostics": [],
"summary": {
"error": 0,
"warning": 0,
"info": 0
}
}
ddd artefacts --format json answers with artefacts, one {"name", "kind"} per
artefact with kind either built-in or plugin, and plugins_without_artefact,
the names the text format puts in a note:
$ ddd artefacts examples/layout/project.ddd.json --format json
{
"artefacts": [
{
"name": "c",
"kind": "built-in"
},
...
{
"name": "layout",
"kind": "plugin"
}
],
"plugins_without_artefact": [],
"diagnostics": [],
"summary": {
"error": 0,
"warning": 0,
"info": 0
}
}
ddd checks --format json is a list rather than an object, one entry per check, each
carrying check, default_severity, description, overridable,
needs_every_component and comparison - the last three being the facts the text format
marks with (fixed), (project) and (comparison). ddd sources --format json
carries its listing as sources, described with the command further down this page.
The exit code is the same everywhere, which lets a build system treat DDD like a compiler:
code |
meaning |
|---|---|
|
the command did what it was asked and found nothing worth reporting. |
|
findings: at least one diagnostic of severity |
|
the command line itself was wrong: a missing or malformed argument, an unknown
severity, or an unknown check that names no plugin, in |
|
the run was interrupted: Ctrl-C, or anything else that raises |
A reader of standard output that stops reading is not an error either: ddd schema component
| head -1 ends at 0 and in silence, where the broken pipe used to be reported as a usage
error and failed a paging script under set -o pipefail.
Every long option is spelled in full. argparse offers any unambiguous prefix by default,
and DDD turns that off: --stand for --standalone would work until the day a second
option begins with those letters, and the script that took the offer would then fail with
“ambiguous option” and nothing else to go on.
The commands
command |
purpose |
|---|---|
|
run every consistency check on a project or on a single component; with |
|
report whether the candidate delivery can stand in for the baseline. Either side may be
an archived dictionary or a project description; |
|
check the project and, if it is consistent, write the named artefact into |
|
print the table of variables with their kind, datatype, unit, shape, initial value
with its physical reading, producer and consumers - the quickest answer to “who
writes this?”. With |
|
print the resolved data dictionary, the contract every backend consumes. This is what
gets archived next to a delivery and handed to |
|
write an |
|
print the json schema of |
|
list every file the project is built out of - the description files and the modules of the plugins it names - for the dependency list of a build system. It reports its findings without letting them change its exit code. |
|
list the artefacts |
|
run the language server, speaking the Language Server Protocol on stdin and stdout, so an editor reports the checks while a description file is being written; see Editor integration. |
|
preview: serve a browser interface over one project’s description files, on this
computer by default, and open the browser on it. The project opens on a graph
of its modules, an arrow per pair coloured by the worst disagreement between
them, laid out in a worker rather than on the page’s own thread, falling back to
ranks alone when the layout overflows its own stack on a chain too long for it -
|
|
record which project description a build runs DDD on and under which severity policy,
the |
|
list every check with its identifier, its default severity, whether it can be relaxed
( |
|
print the directory holding |
|
print the directory holding the example c templates, to copy into a project as a
starting point for its own. They are an example and not a default: no run of
|
|
print, as json, the declarations of the C variables a linked ELF image’s DWARF
describes - by name, by glob, or narrowed to a unit as |
FILE is a project description or a single component description in every command that
takes one. A component checks, lists and dumps on its own - with --standalone holding
back the checks that need the rest of the project - which is what lets a supplier verify a
component long before an integrator ever sees it. ddd generate takes no --standalone:
generating from a component is generating the c and the a2l of a project of one, and the
inputs nobody produces there are errors that stop the run. A supplier who wants the files
anyway asks for them with --force, or silences the checks it has decided about with
-W.
The -t of the c-rendering artefacts has no default at all: an invocation that renders c
without it is refused rather than falling back to templates of DDD’s own.
$ ddd generate all examples/demo/demo.ddd.json -o build/gen
ddd: the c sources are part of this run, so -t/--template-dir is required
A default would have to be somebody’s house style, and a project that inherited one without
choosing it would find out which one only by reading the generated code; Templates
makes that case at length. The a2l is the opposite case, since its structure is ASAM’s rather
than the project’s: the a2l backend is internal and there is no template directory to give
it - which is why ddd generate a2l, the run a build repeats after linking to fill the
addresses in, does not even accept one.
cmake-dir and templates-dir exist for a related reason. Neither the cmake module nor
the example templates have a fixed path once DDD is installed - a wheel, an editable install
and a source checkout put them in three different places - so a project asks the tool it is
actually running where they are instead of hard-coding a guess:
$ ddd templates-dir
/home/you/ddd/examples/templates
How both directories are used from a CMakeLists.txt is in Build integration.
Severity options
check, compare, generate, list and dump all reach the same analysis, so
they all take the same two options for deciding how loud a finding is: -W CHECK=SEVERITY
(repeatable, also spelled --severity) sets one check to error, warning, info
or ignore, and --strict reports every warning as an error.
The reason the policy lives on the command line rather than in the description files is that
the same finding means different things in different places. A component checked on its own
has no counterpart: the components producing its inputs are by definition not part of the
file, nobody reads its outputs yet, and the types, units, sections, constants and rasters it
names are declared in files it was not handed - so the checks that need the rest of the
project have to be held back, while everything DDD can decide from the file alone still
applies. That is what --standalone does on check, list and dump, in one option
rather than in a list of -W a build has to keep in step with the registry;
Consistency checks names the checks it covers, and an explicit -W on the same run
still wins over it.
$ ddd check examples/demo/components/controller.ddd.json
examples/demo/components/controller.ddd.json#component.interface[0]: error[missing-producer]: 'ValueA' is read by component 'Controller' but no component declares it as output
examples/demo/components/controller.ddd.json#component.interface[1]: error[missing-producer]: 'ValueB' is read by component 'Controller' but no component declares it as output
examples/demo/components/controller.ddd.json#component.interface[2]: warning[unused-output]: 'ValueE' is written by component 'Controller' but read by nobody
examples/demo/components/controller.ddd.json#component.interface[3]: warning[unused-output]: 'ValueF' is written by component 'Controller' but read by nobody
examples/demo/components/controller.ddd.json#component.interface[4]: warning[unused-output]: 'StateA' is written by component 'Controller' but read by nobody
examples/demo/components/controller.ddd.json#component.interface[5]: warning[unused-output]: 'StateName' is written by component 'Controller' but read by nobody
examples/demo/components/controller.ddd.json#component.interface[6]: warning[unused-output]: 'ValueG' is written by component 'Controller' but read by nobody
examples/demo/components/controller.ddd.json#component.interface[10]: warning[unused-output]: 'AxisA' is written by component 'Controller' but read by nobody
2 errors, 6 warnings
$ ddd check examples/demo/components/controller.ddd.json --standalone
ok: 14 variables in 1 component are consistent
A check identifier or a severity that DDD does not know is a usage error rather than a silent no-op, because the opposite behaviour would let a typo in a ci script disable a check for years without anybody noticing:
$ ddd check examples/demo/demo.ddd.json -W no-such-check=ignore
ddd: unknown check 'no-such-check'
$ ddd check examples/demo/demo.ddd.json -W unused-output=nope
ddd: unknown severity 'nope' for check 'unused-output', expected one of error, warning, info, ignore
Both exit with 2. Eight checks cannot be relaxed at all - file-not-found,
json-syntax, file-kind, schema, include-cycle, include-depth,
plugin-not-found and
plugin-invalid - because a file that cannot be read has nothing further to say, a
project cannot be interpreted without the plugins it names, or an include tree DDD refuses
to follow stays unread whatever the finding is reported as - and a run that carried on
regardless would report the absence of findings about a project it never saw. ddd checks
marks those (fixed), and an attempt to override one is refused rather than ignored:
$ ddd check examples/demo/demo.ddd.json -W schema=ignore
ddd: the severity of check 'schema' cannot be changed
--strict is the other end of the same dial: it turns every warning into an error, which is
what a delivery build wants, while the daily build of the same project stays readable. The
full list of checks, with the reasoning behind each default severity, is in
Consistency checks.
The sources of a project
A project description does not name its components on the command line; it pulls them in
through includes, possibly through wildcards, and possibly through further project files.
A build system that made the generated code depend on the project file alone would therefore
be wrong in the ordinary case: editing a component would change nothing the build can see, and
the image would happily link yesterday’s globals and ship yesterday’s a2l.
ddd sources closes that gap. It prints one absolute path per line: the project file
itself, every description it includes however deeply, and the module of every
plugin those files name, since a plugin decides what the generation writes
as much as a description does. The demo names none, so its listing is descriptions alone:
$ ddd sources examples/demo/demo.ddd.json
/home/you/ddd/examples/demo/components/controller.ddd.json
/home/you/ddd/examples/demo/components/sensor_hub.ddd.json
/home/you/ddd/examples/demo/components/user_interface.ddd.json
/home/you/ddd/examples/demo/demo.ddd.json
/home/you/ddd/examples/demo/subsystems/logging/event_logger.ddd.json
/home/you/ddd/examples/demo/subsystems/logging/logging.ddd.json
The paths are absolute and always written with forward slashes, on Windows as well, so the list can be pasted into a makefile, a ninja file or a cmake dependency list without being translated first, and a file reached over two different include paths appears once.
The command is deliberately more tolerant than the others: a project whose interfaces disagree
still has a well defined set of source files, and a build system asking what to watch deserves
an answer even while the project does not check out. Only a file that cannot be read at all is
fatal. Tolerant is not silent: a finding the load turned up - a missing include, say - is
reported on stderr after the listing, so a configure step hears about it from the run that
found it rather than from whichever DDD command the build runs next. This is what
cmake/Ddd.cmake uses to make a hand written project description watch its own components,
described in Build integration.
With --format json the same list arrives as the sources array of a json document, next
to the diagnostics and their summary, exactly as the other commands report them.
Reference
The reference below is generated from the argument parser of the tool itself, so an option that is added, renamed or removed cannot leave its documentation behind.
ddd
Data dictionary for the global variables of a component based embedded software project.
usage: ddd [-h] [-v]
{check,compare,generate,list,dump,id,lsp,gui,build-info,schema,artefacts,sources,checks,cmake-dir,templates-dir,tool}
...
- -h, --help
show this help message and exit
- -v, --version
show program’s version number and exit
ddd artefacts
Prints the artefacts ‘ddd generate’ accepts for this project: the built-in ‘c’ and ‘a2l’, and the name of every plugin the project names that provides one. What each artefact writes is not listed here, because a plugin’s file names follow from the resolved project rather than from the plugin alone; ‘ddd generate all –dry-run’ reports those. A plugin providing no backend is no artefact of its own, and is named in a note rather than passed over: its block is still part of what the project’s templates render under ‘c’. Named with –plugin instead of a project, it answers the same question for a build that has not assembled its project description yet.
usage: ddd artefacts [-h] [--plugin MODULE] [--format {text,json}] [project]
- project
project or component description file
- -h, --help
show this help message and exit
- --plugin <module>
load this plugin, a .py path relative to the working directory or a module name; repeatable. For a run that reads no project description, which names its own plugins
- --format {text,json}
output format
ddd build-info
Writes the project description a build runs DDD on, and the severity policy it applies, into a small json file. A build system calls this at configure time so that the language server and ddd gui can report what the build reports. The project description is recorded rather than read: with CMake it is often generated later in the same configure run, out of the link graph.
usage: ddd build-info [-h] -o OUTPUT [--image IMAGE] [-W CHECK=SEVERITY]
[--strict]
project
- project
project or component description file
- -h, --help
show this help message and exit
- -o <output>, --output <output>
file to write the result to
- --image <image>
name of the build target this belongs to
- -W <check=severity>, --severity <check=severity>
severity override the build applies; repeatable
- --strict
the build reports warnings as errors
ddd check
usage: ddd check [-h] [-W CHECK=SEVERITY] [--strict] [--format {text,json}]
[--baseline BASELINE] [--standalone]
project
- project
project or component description file
- -h, --help
show this help message and exit
- -W <check=severity>, --severity <check=severity>
change the severity of a check (error, warning, info, ignore); repeatable
- --strict
report warnings as errors
- --format {text,json}
output format
- --baseline <baseline>
also verify that the project can still replace this published dictionary
- --standalone
check a component on its own: hold back the checks that need every component of a project, as the editor does for a file no build claims; -W still applies
ddd checks
usage: ddd checks [-h] [--format {text,json}] [--plugin MODULE]
- -h, --help
show this help message and exit
- --format {text,json}
output format
- --plugin <module>
load this plugin, a .py path relative to the working directory or a module name; repeatable. For a run that reads no project description, which names its own plugins
ddd cmake-dir
usage: ddd cmake-dir [-h]
- -h, --help
show this help message and exit
ddd compare
Compares two data dictionaries, or two project descriptions, or one of each. The question is directional: can CANDIDATE stand in for BASELINE?
usage: ddd compare [-h] [--renames RENAMES] [--plugin MODULE]
[-W CHECK=SEVERITY] [--strict] [--format {text,json}]
baseline candidate
- baseline
the published dictionary or project
- candidate
the delivery to judge
- -h, --help
show this help message and exit
- --renames <renames>
also write the old-to-new name pairs here, for migrating datasets and recordings
- --plugin <module>
load this plugin, a .py path relative to the working directory or a module name; repeatable. For a run that reads no project description, which names its own plugins
- -W <check=severity>, --severity <check=severity>
change the severity of a check (error, warning, info, ignore); repeatable
- --strict
report warnings as errors
- --format {text,json}
output format
ddd dump
usage: ddd dump [-h] [-W CHECK=SEVERITY] [--strict] [--format {text,json}]
[-o OUTPUT] [--standalone]
project
- project
project or component description file
- -h, --help
show this help message and exit
- -W <check=severity>, --severity <check=severity>
change the severity of a check (error, warning, info, ignore); repeatable
- --strict
report warnings as errors
- --format {text,json}
format of the diagnostics, which go to stderr on this command; the dictionary is json either way
- -o <output>, --output <output>
write the dictionary to this file instead of stdout, leaving the file untouched when its content would not change
- --standalone
dump a component on its own: hold back the checks that need every component of a project, as the editor does for a file no build claims; -W still applies
ddd generate
Generates the artefacts of a project, each out of the same resolved data dictionary. The artefact is part of the command, so every run states what it produces and carries only the options of that artefact: only a run that renders c takes a template directory, only one that writes the a2l takes an address map. ‘all’ produces both, and the artefact of every plugin the project names that provides one, and takes –without to leave one of the built-in artefacts out of that; ‘a2l’ is the run a build repeats after linking, when the addresses are known but the c must not change.
usage: ddd generate [-h] {c,a2l,all,<plugin>} ...
- -h, --help
show this help message and exit
ddd generate a2l
usage: ddd generate a2l [-h] [-W CHECK=SEVERITY] [--strict]
[--format {text,json}] -o OUTPUT_DIR
[--byte-order {little,big}]
[--address-map ADDRESS_MAP] [--dictionary FILE]
[--dry-run] [--force]
project
- project
project or component description file
- -h, --help
show this help message and exit
- -W <check=severity>, --severity <check=severity>
change the severity of a check (error, warning, info, ignore); repeatable
- --strict
report warnings as errors
- --format {text,json}
output format
- -o <output_dir>, --output-dir <output_dir>
directory the generated files are written to
- --byte-order {little,big}
byte order reported in the a2l file, default: little
- --address-map <address_map>
json file mapping variable names to their address in the target
- --dictionary <file>
also write the resolved data dictionary, the text ddd dump prints, to this file, in the same write as the artefacts: all of them or none
- --dry-run
report what would be written, write nothing
- --force
generate even if the consistency check fails
ddd generate all
usage: ddd generate all [-h] [-W CHECK=SEVERITY] [--strict]
[--format {text,json}] -o OUTPUT_DIR [-t TEMPLATE_DIR]
[--const-inputs] [--byte-order {little,big}]
[--address-map ADDRESS_MAP] [--without {c,a2l}]
[--dictionary FILE] [--dry-run] [--force]
project
- project
project or component description file
- -h, --help
show this help message and exit
- -W <check=severity>, --severity <check=severity>
change the severity of a check (error, warning, info, ignore); repeatable
- --strict
report warnings as errors
- --format {text,json}
output format
- -o <output_dir>, --output-dir <output_dir>
directory the generated files are written to
- -t <template_dir>, --template-dir <template_dir>
directory holding the jinja2 templates of the c sources. Every file in it ending in .jinja2 is rendered to a file named like the template without that extension, so ddd_globals.c.jinja2 produces ddd_globals.c; a name starting with an underscore is a helper that renders nothing on its own, and a name containing {component} is rendered once per component. ‘ddd templates-dir’ prints a set of example templates to copy from
- --const-inputs
declare input variables const in the consumer headers
- --byte-order {little,big}
byte order reported in the a2l file, default: little
- --address-map <address_map>
json file mapping variable names to their address in the target
- --without {c,a2l}
leave one of the built-in artefacts out of this run, repeatable. The plugins’ artefacts are produced either way, so ‘generate all –without a2l’ is how a build that writes the a2l later, once the addresses are known, asks for everything else
- --dictionary <file>
also write the resolved data dictionary, the text ddd dump prints, to this file, in the same write as the artefacts: all of them or none
- --dry-run
report what would be written, write nothing
- --force
generate even if the consistency check fails
ddd generate c
usage: ddd generate c [-h] [-W CHECK=SEVERITY] [--strict]
[--format {text,json}] -o OUTPUT_DIR -t TEMPLATE_DIR
[--const-inputs] [--dictionary FILE] [--dry-run]
[--force]
project
- project
project or component description file
- -h, --help
show this help message and exit
- -W <check=severity>, --severity <check=severity>
change the severity of a check (error, warning, info, ignore); repeatable
- --strict
report warnings as errors
- --format {text,json}
output format
- -o <output_dir>, --output-dir <output_dir>
directory the generated files are written to
- -t <template_dir>, --template-dir <template_dir>
directory holding the jinja2 templates of the c sources. Every file in it ending in .jinja2 is rendered to a file named like the template without that extension, so ddd_globals.c.jinja2 produces ddd_globals.c; a name starting with an underscore is a helper that renders nothing on its own, and a name containing {component} is rendered once per component. ‘ddd templates-dir’ prints a set of example templates to copy from
- --const-inputs
declare input variables const in the consumer headers
- --dictionary <file>
also write the resolved data dictionary, the text ddd dump prints, to this file, in the same write as the artefacts: all of them or none
- --dry-run
report what would be written, write nothing
- --force
generate even if the consistency check fails
ddd gui
Preview. Serves a browser interface over one project’s description files, and opens the browser on it. The server binds the loopback address of this computer alone by default; –host widens that, for a container. Every change is written into the description files in their own layout and checked with the same analysis as ddd check. It runs until it is interrupted, and its options are not yet part of the stable interface.
usage: ddd gui [-h] [-b DIR] [--host ADDRESS] [--port N] [--no-browser]
[PROJECT]
- project
the project description to open; without it the start page lists the projects found under the current directory
- -h, --help
show this help message and exit
- -b <dir>, --build-directory <dir>
directory holding a build of the project, whose severities apply; repeatable. Without it the usual build directory names are searched
- --host <address>
IPv4 address to listen on, or a name that resolves to one; the default answers this computer alone, and 0.0.0.0 is what a container gives its host once the same port is published
- --port <n>
port to serve on; the default, 0, lets the system pick a free one, refused when –host answers beyond this computer’s loopback
- --no-browser
print the address without opening a browser on it
ddd id
Stamps an ‘id’ into each declaration of scope ‘output’ or ‘local’ that does not carry one, editing the files in place. An identity is what lets a later ‘ddd compare’ report a rename as a rename. A declaration that already has one is left alone, so a second run changes nothing.
usage: ddd id [-h] --assign files [files ...]
- files
the description files to stamp
- -h, --help
show this help message and exit
- --assign
write the ids; required, so that no run edits a file by accident
ddd list
usage: ddd list [-h] [-W CHECK=SEVERITY] [--strict] [--format {text,json}]
[--standalone]
project
- project
project or component description file
- -h, --help
show this help message and exit
- -W <check=severity>, --severity <check=severity>
change the severity of a check (error, warning, info, ignore); repeatable
- --strict
report warnings as errors
- --format {text,json}
output format
- --standalone
list a component on its own: hold back the checks that need every component of a project, as the editor does for a file no build claims; -W still applies
ddd lsp
Speaks the Language Server Protocol on stdin and stdout. It reports the consistency checks while a description file is being written, which a json schema cannot do: whether an axis names a declared axis, whether exactly one component produces a name, whether two components agree on a unit. Which project a file belongs to is read from the ‘ddd-build.json’ that ddd_generate writes, so the editor and the build apply the same severities.
usage: ddd lsp [-h] [-b DIR]
- -h, --help
show this help message and exit
- -b <dir>, --build-directory <dir>
directory holding a build of this project; repeatable. Without it the usual build directory names next to the workspace are searched
ddd schema
Prints the json schema of one file format, or writes every schema into a directory with ‘all’. Committing those files and pointing the ‘$schema’ key of each description at the matching one is what gives an editor completion, hover documentation and validation while a description file is being written.
usage: ddd schema [-h] [-o OUTPUT] [--plugin MODULE]
{component,constants,dictionary,project,rasters,sections,types,units,all}
- kind
- -h, --help
show this help message and exit
- -o <output>, --output <output>
write to this file instead of stdout; with ‘all’ it is the directory the schemas are written into, each named ‘ddd_<kind>.schema.json’
- --plugin <module>
load this plugin, a .py path relative to the working directory or a module name; repeatable. For a run that reads no project description, which names its own plugins
ddd sources
Prints one absolute path per line: the project file, every file it includes however deeply, and the module of every plugin those files name. A build system needs exactly this to know when the generated files are out of date, because a project pulls its components in through ‘includes’ and names its plugins under ‘plugins’, and none of them is named on the command line.
usage: ddd sources [-h] [--format {text,json}] project
- project
project or component description file
- -h, --help
show this help message and exit
- --format {text,json}
output format
ddd templates-dir
The c sources are rendered from templates the project provides, so that their house style is the project’s own. The templates printed here are a working set to copy into a project and change, not a default: nothing falls back to them.
usage: ddd templates-dir [-h]
- -h, --help
show this help message and exit
ddd tool
The toolbox holds what is run once rather than in every build: a tool that turns something a project already has into DDD descriptions, or DDD descriptions into something else. Each tool is a command of its own under this one.
usage: ddd tool [-h] {from-elf} ...
- -h, --help
show this help message and exit
ddd tool from-elf
Reads a linked ELF image and its DWARF debug information, and prints as json the declaration of every C variable named or matched: its kind, datatype, shape, enumerators, structure members, initial value and section, as the image states them. What an image does not state - a unit, a description, limits, a scaling, whether an array is a curve - is left out, and said once. DDD itself checks every entry, as ‘ddd check –standalone’ checks a component, before it is printed. Needs an image built with debug information (-g).
usage: ddd tool from-elf [-h] [--component NAME]
[--scope {output,local,input}] [-o OUTPUT] [--force]
[--format {text,json}]
image SYMBOL [SYMBOL ...]
- image
the linked ELF image, built with debug information (-g)
- symbol
a C variable, by name or by a pattern in shell glob syntax, prefixed with UNIT: to take it from one compilation unit, for a static several units define
- -h, --help
show this help message and exit
- --component <name>
print a component file of this name, holding the types its structures need, rather than a list of interface entries
- --scope {output,local,input}
the scope of every entry; input leaves out the initial value and the section, which a consumer does not state
- -o <output>, --output <output>
write the declarations to this file instead of stdout, leaving the file untouched when its content would not change
- --force
write the declarations that were described even where others were not; the exit code still reports the errors
- --format {text,json}
format of the diagnostics, which go to stderr on this command; the declarations are json either way