Skip to content

Instantly share code, notes, and snippets.

@orklann
Created October 28, 2021 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orklann/2f5c2989cdf0a84a1f6ff96f9c442c13 to your computer and use it in GitHub Desktop.
Save orklann/2f5c2989cdf0a84a1f6ff96f9c442c13 to your computer and use it in GitHub Desktop.
Generating .clang_complete for current folder
#!/usr/bin/env python3
import os
def walk_through_files(path, file_extension='.h'):
for (dirpath, dirnames, filenames) in os.walk(path):
for filename in filenames:
if filename.endswith(file_extension):
yield os.path.join(dirpath, filename)
current_dir = os.getcwd()
for fname in walk_through_files(current_dir):
print('-include "' + fname + '"')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment