#!/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