I am trying to run chekstyle on all of my files within a project. So I have model, view, and controller folders all with their subfolders of .h and .cpp files. Is there any way to grab all the files that end in .h or .cpp without having to individually specify the folders I want to check? Right now my command is something like: CppCheckStyle inc/.h src/.cpp, etc,etc...but I'd rather skip the hassle of specifying all of the folder names.

Thanks!

Re: Grabbing all .cpp or .h files within directory of subdirectories and files 80 80

I think find might work in this instance.
find -name "*.h" -exec CppCheckStyle {} \; -o -name "*.cpp" -exec CppCheckStyle {} \;

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.