Skip to content

Commit

Permalink
add the comment changing script
Browse files Browse the repository at this point in the history
  • Loading branch information
rpavlik committed Sep 14, 2011
1 parent adbc963 commit 1572f38
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions devtools/commentchanger
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
# Simple script to change C++-style // comments to C style ones.
# Puts one space after (and if not present, before) the contents of the comment
# Not suitable for unattended use - inspect results before staging and committing.
# 2011 Ryan Pavlik <abiryan@ryand.net> <rpavlik@iastate.edu> <http://academic.cleardefinition.com>

# Handle comments with text before them. Explicitly excludes :// to not
# recklessly mangle license headers with URLs in them.
sed -i -r 's_([^:/])//[ ]?(.*)$_\1/* \2 */_' $@

# Handle comments that start at the beginning of the line.
sed -i -r 's_^//[ ]?(.*)$_/* \1 */_' $@

0 comments on commit 1572f38

Please sign in to comment.