tools: showerr.sh to colorize nc* outputs
[nit.git] / src / nc
diff --git a/src/nc b/src/nc
index b09267d..2b529f7 100755 (executable)
--- a/src/nc
+++ b/src/nc
@@ -15,7 +15,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-NITC="../bin/nitc"
+NITC="../c_src/nitc"
 NITCOPTS= #"-I parser -I metamodel -I syntax -I compiling -I tmp"
 
 name=`basename $0`
@@ -27,6 +27,13 @@ case $name in
        *) echo "unknown mode $name"; exit 1;;
 esac
 
-echo ${NITC} ${NITCOPTS} ${opts} "$@"
-${NITC} ${NITCOPTS} ${opts} "$@"
+./git-gen-version.sh "$name"
 
+echo ${NITC} ${NITCOPTS} ${opts} "$@"
+k=$(mktemp nc.stderr.XXXXX)
+rm "$k"
+trap "rm -f $k; exit 1" INT TERM
+mkfifo "$k"
+${NITC} ${NITCOPTS} ${opts} "$@" 2>"$k" &
+./showerr.sh <"$k"
+rm "$k"