cppw
Query a Linux system's power status
SYNOPSIS
cppw [options] file...
PARAMETERS
-I
Add the specified directory to the list of directories to be searched for header files. This is equivalent to the `-I` option for `cpp`.
-D
Define the macro `
-U
Undefine the macro `
-nostdinc
Do not search the standard system directories for header files. This is equivalent to the `-nostdinc` option for `cpp`.
-help
Display a help message.
file...
One or more C, C++, or Objective-C source files to be preprocessed and analyzed.
DESCRIPTION
The `cppw` command analyzes C, C++, or Objective-C source files and provides a count of words after preprocessing. It uses the system's C preprocessor (`cpp`) to expand macros, include headers, and handle conditional compilation directives before performing the word count. This can be useful for understanding the effective size of code after preprocessing, especially when considering the impact of large header files or extensive macro usage. The command avoids temporary file creation by piping the output of `cpp` directly to the word counting utility, optimizing performance. It gives insights into codebase size and helps in code analysis and project metric assessments. The user needs to make sure the proper compiler is present on the machine, otherwise `cpp` will not be available and the command won't work.
EXAMPLE USAGE
To count the words in `my_program.c` after preprocessing:
`cppw my_program.c`
To count words with a custom include path:
`cppw -I/path/to/headers my_program.c`
To define a macro before preprocessing:
`cppw -DDEBUG my_program.c`