IWYU_TOOL(1)

NAME
iwyu_tool - Include-what-you-use compilation database driver

SYNOPSIS
iwyu_tool [-h] [-v] [-o FORMAT] [-j JOBS] -p build-path [source ...] -- [IWYU-args]

DESCRIPTION
Driver to consume a clang(1) compilation database and invoke include-what-you-use(1).

OPTIONS

  positional arguments:

source
    Zero or more source files to run IWYU on. Defaults to all in compilation database.

  optional arguments:

-h, --help
    Show help message and exit.

-v, --verbose
    Print IWYU commands.

-o FORMAT, --output-format FORMAT
    Select output format, which may be one of:

    iwyu
        Native output format of include-what-you-use(1). (default)

    clang
        Format similar to the output of clang(1), where issues are reported as errors.

    clang-warning
        Similar to clang, but issues are reported as warnings.

-j JOBS, --jobs JOBS
    Number of concurrent subprocesses.

-p build-path
    Compilation database path. Either a path to a directory containing a file named compile_commands.json or to the file itself.

IWYU-args
    All further arguments after the separator -- are passed on to each invocation of include-what-you-use(1).

FILES

compile_commands.json
    Compilation database file.

NOTES
Assumes include-what-you-use(1) is available on the PATH.

EXAMPLE
Example usage with cmake(1) on Unix systems:
    $ mkdir build && cd build
    $ CC="clang" CXX="clang++" cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ...
    $ iwyu_tool -p .

SEE ALSO
include-what-you-use(1), clang(1).