Skip to content

Commit

Permalink
Add nuke_format, a tool to vaporize a format. Tested on yahoo and map…
Browse files Browse the repository at this point in the history
…send.
  • Loading branch information
robertlipe committed Dec 8, 2021
1 parent 40429dd commit d9dcfd9
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions tools/nuke_format
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d9dcfd9

Please sign in to comment.