QGIS/scripts/sipdiff
Matthias Kuhn ca008d7a48 Add script to generate sip code from headers
Add more annotations

Add some references to upstream documentation

Add more annotations
2017-03-30 15:13:01 +02:00

39 lines
605 B
Bash
Executable File

#!/usr/bin/env bash
# ARGUMENTS
REMOVE_COMMENTS=YES
while getopts ":c" opt; do
case $opt in
c)
# keep comments
REMOVE_COMMENTS=NO
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
esac
done
shift $(expr $OPTIND - 1)
# GNU prefix command for mac os support (gsed, gsplit)
GP=
if [[ "$OSTYPE" =~ darwin* ]]; then
GP=g
fi
for file in $*; do
d=${file#*/}
d=${d%/*}
f=${file##*/}
f=${f%.*}
tempfile=$(${GP}mktemp ${f}XXXX --suffix=.h)
./scripts/sipify.pl "src/$d/$f.h" > $tempfile
vimdiff $tempfile python/$d/$f.sip
rm $tempfile
done