diff --git a/tools/nuke_format b/tools/nuke_format new file mode 100755 index 000000000..d492a4c12 --- /dev/null +++ b/tools/nuke_format @@ -0,0 +1,48 @@ +# usage nuke_format format_name + +SED=$(which gsed) +EDITOR="${EDITOR:-vim}" + +# $1 = format $2 = file +remove_word() { +# git add $2 + $SED -i "s/$1//g" $2 +} + +remove_line_containing() { +# git add $2 + $SED -i "/$1/d" $2 +} + +# For things it's easier to just edit away.:1 +remove_manually() { + grep $1 $2 && $EDITOR +/$1 $2 + # git add $2 +} + +remove_word $1.cc CMakelists.txt +remove_word $1.h CMakelists.txt +remove_word $1.cc GPSBabel.pro +remove_word $1.h GPSBabel.pro + +remove_manually $1 reference/help.txt + +remove_line_containing $1 reference/format0.txt +remove_line_containing $1 reference/format1.txt +remove_line_containing $1 reference/format2.txt +remove_manually $1 reference/format3.txt +remove_line_containing extern.*$1 vecs.h +remove_line_containing Format.*$1 vecs.h +remove_line_containing include.*$1 vecs.h +remove_manually $1 reference/format3.txt +remove_line_containing $1 msvc/GPSBabel.vcxproj +remove_line_containing $1 msvc/GPSBabel.vcxproj.filters + +git rm -f reference/$1* +git rm -f xmldoc/formats/$1.xml +git rm -f xmldoc/formats/options/$1.xml +git rm -f testo.d/$1.test +git rm -f $1.cc +git rm -f $1.h + +# make && ./testo