Skip to content

Commit

Permalink
Wrappers improved
Browse files Browse the repository at this point in the history
  • Loading branch information
projedi committed May 14, 2013
1 parent 1179b49 commit 054dde8
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 22 deletions.
12 changes: 1 addition & 11 deletions sclang
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
#!/bin/sh
# USAGE: sclang [stfs flags] -- [clang flags]

STFW_FLAGS=

while [ $1 != '--' ]; do
STFW_FLAGS=$STFW_FLAGS' '$1
shift
done

shift

clang $* 2>&1 | ./stfw.py $STFW_FLAGS
./wrapper.sh "clang" $0 $*
3 changes: 3 additions & 0 deletions sclang++
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

./wrapper.sh "clang++" $0 $*
3 changes: 3 additions & 0 deletions sg++
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

./wrapper.sh "g++ -Wall" $0 $*
12 changes: 1 addition & 11 deletions sgcc
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
#!/bin/sh
# USAGE: sgcc [stfs flags] -- [gcc flags]

STFW_FLAGS=

while [ $1 != '--' ]; do
STFW_FLAGS=$STFW_FLAGS' '$1
shift
done

shift

gcc -Wall $* 2>&1 | ./stfw.py $STFW_FLAGS
./wrapper.sh "gcc -Wall" $0 $*
32 changes: 32 additions & 0 deletions wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh

executable=$1
shift
script=$1
shift

function usage() {
echo "Wrapper usage: $script [stfw flags] -- [gcc flags]"
echo -n "Utility "
./stfw.py --help
}

STFW_FLAGS=

while [ \( "$1" != '--' \) -a -n "$1" ]; do
if [ \( $1 == '--help' \) -o \( $1 == '-h' \) ]; then
usage
exit 0
fi
STFW_FLAGS=$STFW_FLAGS' '$1
shift
done

if [ -z $1 ]; then
usage
exit 0
fi

shift

$executable $* 2>&1 | ./stfw.py $STFW_FLAGS

0 comments on commit 054dde8

Please sign in to comment.