CITNAMES(1) | CITNAMES(1) |
citnames - Deduce command semantic
citnames [options] --input <file> --output <file>
The name citnames comes from to reverse the word “semantic”.
Because when you type a command, you know your intent. The command execution is just a thing to achieve your goal. This program takes the command which was executed, and try to find out what the intent was to run that command. It deduces the semantic of the command.
This is useful to generate a compilation database. Citnames get a list of commands, and it creates a JSON compilation database. (This is currently the only output of the tool.)
Citnames exit status is non zero in case of IO problems, otherwise it’s zero. The exit status is independent from how many command it recognized or was it recognized at all.
Any insight about the command recognition logic can be observed with --verbose flag on the standard error. Otherwise the command is silent.
It’s a JSON file, with the command execution history. (Plus some metadata, that is useful for debugging the application which was produced it.) This file can be produced by the intercept command, which records the process executions of a build.
Read more about the syntax of the file in the intercept man page.
Currently the only output format is the JSON compilation database. Read more about the syntax of that in the bear man page.
The config file influences the command recognition (by the section “compilation”) and the output format (by the section “output”).
The config file is optional. The program will use default values, which can be dumped with the --verbose flags.
Some parts of the file has overlap with the command line arguments. If both present the command line argument overrides the config file values.
{
"compilation": {
"compilers_to_recognize": [
{
"executable": "/usr/bin/mpicc",
"additional_flags": ["-I/opt/MPI/include"]
}
],
"compilers_to_exclude": []
},
"output": {
"content": {
"include_only_existing_source": true,
"paths_to_include": [],
"paths_to_exclude": []
},
"format": {
"command_as_array": true,
"drop_output_field": false
}
} }
Copyright (C) 2012-2021 by László Nagy <https://github.com/rizsotto/Bear>
László Nagy.
September 14, 2020 | Bear User Manuals |