summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-10-28 16:14:01 +0000
committerpaltherr <paltherr@epfl.ch>2003-10-28 16:14:01 +0000
commit95ed9ff085526ce0bc1c99281fbe46787eb18bf1 (patch)
tree76ffa953682bf8dd237eed0174fe86c3c20aa544 /sources
parent4c58fa7b64ca443e59f63837932151e1fb11987c (diff)
downloadscala-95ed9ff085526ce0bc1c99281fbe46787eb18bf1.tar.gz
scala-95ed9ff085526ce0bc1c99281fbe46787eb18bf1.tar.bz2
scala-95ed9ff085526ce0bc1c99281fbe46787eb18bf1.zip
- Implemented command "scala"
Diffstat (limited to 'sources')
-rw-r--r--sources/bin/.scala_wrapper.tmpl29
1 files changed, 29 insertions, 0 deletions
diff --git a/sources/bin/.scala_wrapper.tmpl b/sources/bin/.scala_wrapper.tmpl
index 5722af402e..ee2d37c363 100644
--- a/sources/bin/.scala_wrapper.tmpl
+++ b/sources/bin/.scala_wrapper.tmpl
@@ -454,6 +454,34 @@ scala_info() {
}
##############################################################################
+# Implementation of scala
+
+# Returns true if the given arguments contain a Xbootclasspath: flag.
+scala_has_bootclasspath() {
+ while [ $# != 0 ]; do
+ case "$1" in
+ -Xbootclasspath:* ) return 0;;
+ -cp | -classpath ) shift 2;;
+ -jar ) return 1;;
+ -* ) shift 1;;
+ * ) return 1;;
+ esac;
+ done;
+ return 1;
+}
+
+# Entry point of scala-info.
+scala() {
+ compute_variable EXEC;
+ if scala_has_bootclasspath "$@"; then
+ $EXEC java "$@";
+ else
+ compute_variable RUNTIME_CLASSES;
+ $EXEC java "-Xbootclasspath/a:$RUNTIME_CLASSES" "$@";
+ fi;
+}
+
+##############################################################################
# Definition of UNAME, SOURCE, SCRIPT, PREFIX and VERSION
unset SCRIPT;
@@ -489,6 +517,7 @@ unset JAVA_CLASSPATH;
configure;
case "$SCRIPT" in
+ scala ) scala "$@";;
scala-info ) scala_info "$@";;
scalac* ) exec_compile scalac.Main "$@";;
scaladoc* ) exec_compile scala.tools.scaladoc.Main "$@";;