The R Project SVN R

Rev

Rev 3076 | Rev 5458 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3076 Rev 4580
Line 25... Line 25...
25
use Getopt::Long;
25
use Getopt::Long;
26
use File::Basename;
26
use File::Basename;
27
use Cwd;
27
use Cwd;
28
 
28
 
29
$cwd=getcwd();
29
$cwd=getcwd();
30
if($ENV{"RHOME"}){
30
if($ENV{"R_HOME"}){
31
    $RHOME=$ENV{"RHOME"};
31
    $R_HOME=$ENV{"R_HOME"};
32
}
32
}
33
else{
33
else{
34
    $RHOME = `R RHOME`;
34
    $R_HOME = `R RHOME`;
35
    $RHOME =~ s/(.*)\n*/$1/;
35
    $R_HOME =~ s/(.*)\n*/$1/;
36
}
36
}
37
 
37
 
38
chdir($cwd);
38
chdir($cwd);
39
 
39
 
40
require "$RHOME/etc/Rdconvlib.pl";
40
require "$R_HOME/etc/Rdconvlib.pl";
41
 
41
 
42
@knownoptions = ("debug|d", "type|t:s", "help|h");
42
@knownoptions = ("debug|d", "type|t:s", "help|h");
43
GetOptions (@knownoptions) || usage();
43
GetOptions (@knownoptions) || usage();
44
 
44
 
45
usage() if $opt_help;
45
usage() if $opt_help;
46
print stderr "RHOME: '$RHOME';  cwd='$cwd'\n" if $opt_debug;
46
print stderr "R_HOME: '$R_HOME';  cwd='$cwd'\n" if $opt_debug;
47
 
47
 
48
##-- In the future, we want allow  SEVERAL types simultaneously ... :
48
##-- In the future, we want allow  SEVERAL types simultaneously ... :
49
if($opt_type =~ /html/i){
49
if($opt_type =~ /html/i){
50
    Rdconv($ARGV[0],$opt_type,$opt_debug, 0);# filename 0 : STDOUT
50
    Rdconv($ARGV[0],$opt_type,$opt_debug, 0);# filename 0 : STDOUT
51
}
51
}