LinuxCommandLibrary

cppclean

cppclean

TLDR

Run in a project's directory

$ cppclean [path/to/project]
copy


Run on a project where the headers are in the inc1/ and inc2/ directories
$ cppclean [path/to/project] --include-path=[inc1] --include-path=[inc2]
copy


Run on a specific file main.cpp
$ cppclean [main.cpp]
copy


Run on the current directory, excluding the "build" directory
$ cppclean [.] --exclude=[build]
copy

Help

usage: cppclean [-h] [--exclude pattern] [--include-path path] 
                [--include-path-system sys_path] 
                [--include-path-non-system nonsys_path] [--verbose] 
                [--version] [--quiet] 
                files [files ...] 

positional arguments:
  files 

options:
  -h, --help            show this help message and exit 
  --exclude pattern     exclude files matching this pattern; specify this 
                        multiple times for multiple patterns 
  --include-path path, -i path, -I path 
                        add a header include path; specify this multiple times 
                        for multiple include paths 
  --include-path-system sys_path, -s sys_path 
                        same as --include-path but explicitly designates all 
                        header files found in these directories as "system" 
                        includes 
  --include-path-non-system nonsys_path, -n nonsys_path 
                        same as --include-path but explicitly designates all 
                        header files found in these directories as "non- 
                        system" includes 
  --verbose             print verbose messages 
  --version             show program's version number and exit 
  --quiet, -q           ignore parse errors 

Copied to clipboard