Skip to content

Instantly share code, notes, and snippets.

@jstimpfle
Created April 30, 2017 13:13
Show Gist options
  • Save jstimpfle/275ca20ce93ca30a9a55bf6ace627ab7 to your computer and use it in GitHub Desktop.
Save jstimpfle/275ca20ce93ca30a9a55bf6ace627ab7 to your computer and use it in GitHub Desktop.
#!/usr/bin/python3
# This is useful for editing multi-line C macros
import sys
lines = [line.rstrip(' \\\n').rstrip() for line in sys.stdin]
maxlen = max(len(line) for line in lines)
for line in lines:
print(line + ' '*(2 + maxlen - len(line)) + '\\')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment