summaryrefslogtreecommitdiff
path: root/math/R-letter/files/R
diff options
context:
space:
mode:
Diffstat (limited to 'math/R-letter/files/R')
-rw-r--r--math/R-letter/files/R77
1 files changed, 30 insertions, 47 deletions
diff --git a/math/R-letter/files/R b/math/R-letter/files/R
index fdb58232ac6a..9b6eedb5a3fa 100644
--- a/math/R-letter/files/R
+++ b/math/R-letter/files/R
@@ -1,50 +1,38 @@
#!/bin/sh
# Shell wrapper for R executable.
-# Just sets a few environment items
RHOME=PREFIX/share/R
export RHOME
-if [ "$1" = "RHOME" ]
-then
- echo $RHOME; exit 0
-fi
-
-if [ "$1" = "SHLIB" ]
-then
- shift
- exec sh $RHOME/etc/SHLIB $*
-fi
-
-if [ "$1" = "COMPILE" ]
-then
- shift
- exec sh $RHOME/etc/COMPILE $*
-fi
-
-if [ "$1" = "INSTALL" ]
-then
- shift
- exec sh $RHOME/etc/INSTALL $*
-fi
-
-if [ "$1" = "REMOVE" ]
-then
- shift
- exec sh $RHOME/etc/REMOVE $*
-fi
-
-if [ "$1" = -xxgdb ]
-then
- shift
- DEBUGGER=xxgdb
-fi
-
-if [ "$1" = -gdb ]
-then
- shift
- DEBUGGER=gdb
-fi
+ARG=$1
+case ${ARG} in
+ RHOME)
+ echo ${RHOME}; exit 0 ;;
+ CMD)
+ shift; PATH=$PATH:$RHOME/cmd:$RHOME/etc exec $* ;;
+ SHLIB|COMPILE|INSTALL|REMOVE)
+ shift; exec sh ${RHOME}/etc/${ARG} $* ;;
+ -d|--debugger)
+ exec $2 ${RHOME}/bin/R.binary ;;
+ -h|--help|-\?)
+ echo "Usage: R [OPTIONS] [< INFILE] [> OUTFILE]"
+ echo ""
+ echo "Options:"
+ echo " --save Do save data sets at the end of the session."
+ echo " --no-save Don't save them."
+ echo " --restore Do restore previously saved data sets at startup."
+ echo " --no-restore Don't restore them."
+ echo " --no-readline Don't use readline for command-line editing."
+ echo " --no-site-file Don't read the site-wide Rprofile."
+ echo " --no-init-file Don't read the .Rprofile or ~/.Rprofile files."
+ echo " -v N Set the vector heap size to N megabytes."
+ echo " -n N Set the number of cons cells to N."
+ echo " -h, --help, -? Print short help message and exit."
+ echo " -q, --quiet Make R run as quietly as possible."
+ echo " -V, --version Print version info and exit."
+ echo " -d NAME, --debugger NAME Run R through debugger NAME."
+ exit 0 ;;
+esac
# Default Printer Paper Size
# Choose one of the following
@@ -61,9 +49,4 @@ export R_PAPERSIZE
R_PRINTCMD=lpr
export R_PRINTCMD
-if [ $DEBUGGER ]
-then
- exec $DEBUGGER $RHOME/bin/R.binary
-else
- exec $RHOME/bin/R.binary $*
-fi
+exec ${RHOME}/bin/R.binary $*