about summary refs log tree commit diff stats
path: root/subx
diff options
context:
space:
mode:
Diffstat (limited to 'subx')
-rwxr-xr-xsubx/dgen18
-rwxr-xr-xsubx/drun18
-rwxr-xr-xsubx/gen18
-rwxr-xr-xsubx/run18
4 files changed, 40 insertions, 32 deletions
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