From 257ebf7f508d0a0352abf732019f00a1b3962741 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sat, 9 Mar 2019 14:13:56 -0800 Subject: 4997 --- subx/dgen | 18 ++++++++++-------- subx/drun | 18 ++++++++++-------- subx/gen | 18 ++++++++++-------- subx/run | 18 ++++++++++-------- 4 files changed, 40 insertions(+), 32 deletions(-) (limited to 'subx') diff --git a/subx/dgen b/subx/dgen index 34f49deb..4aeec375 100755 --- a/subx/dgen +++ b/subx/dgen @@ -16,11 +16,13 @@ fi # subx_bin is up to date. export CFLAGS=-g -if [[ $1 == 'ex'* ]] -then - ./subx --map translate examples/$1.subx -o examples/`echo $1 |sed 's/\..*//'` - exit $? -fi - -./subx --map translate *.subx apps/$1.subx -o apps/`echo $1 |sed 's/\..*//'` -exit $? +case $1 in + ex*) + ./subx --map translate examples/$1.subx -o examples/`echo $1 |sed 's/\..*//'` + exit $? + ;; + *) + ./subx --map translate *.subx apps/$1.subx -o apps/`echo $1 |sed 's/\..*//'` + exit $? + ;; +esac diff --git a/subx/drun b/subx/drun index 15c7f747..b094f995 100755 --- a/subx/drun +++ b/subx/drun @@ -10,11 +10,13 @@ then exit 1 fi -if [[ $1 == 'ex'* ]] -then - CFLAGS=-g ./subx --map --trace run examples/$* - exit $? -fi - -CFLAGS=-g ./subx --map --trace run apps/$* -exit $? +case $1 in + ex*) + ./subx --map --trace run examples/$* + exit $? + ;; + *) + ./subx --map --trace run apps/$* + exit $? + ;; +esac diff --git a/subx/gen b/subx/gen index a2f1de4a..0acbe3d8 100755 --- a/subx/gen +++ b/subx/gen @@ -16,11 +16,13 @@ fi # subx_bin is up to date. export CFLAGS=-g -if [[ $1 == 'ex'* ]] -then - ./subx translate examples/$1.subx -o examples/`echo $1 |sed 's/\..*//'` - exit $? -fi - -./subx translate *.subx apps/$1.subx -o apps/`echo $1 |sed 's/\..*//'` -exit $? +case $1 in + ex*) + ./subx translate examples/$1.subx -o examples/`echo $1 |sed 's/\..*//'` + exit $? + ;; + *) + ./subx translate *.subx apps/$1.subx -o apps/`echo $1 |sed 's/\..*//'` + exit $? + ;; +esac diff --git a/subx/run b/subx/run index cbb3e576..99de0777 100755 --- a/subx/run +++ b/subx/run @@ -10,11 +10,13 @@ then exit 1 fi -if [[ $1 == 'ex'* ]] -then - CFLAGS=-g ./subx run examples/$* - exit $? -fi - -CFLAGS=-g ./subx run apps/$* -exit $? +case $1 in + ex*) + ./subx run examples/$* + exit $? + ;; + *) + ./subx run apps/$* + exit $? + ;; +esac -- cgit 1.4.1-2-gfad0