The R Project SVN R

Rev

Rev 42314 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 42314 Rev 46994
Line 23... Line 23...
23
use Getopt::Long;
23
use Getopt::Long;
24
use R::Rdconv;
24
use R::Rdconv;
25
use R::Utils;
25
use R::Utils;
26
use R::Vars;
26
use R::Vars;
27
 
27
 
28
my $revision = ' $Rev: 42314 $ ';
28
my $revision = ' $Rev: 46994 $ ';
29
my $version;
29
my $version;
30
my $name;
30
my $name;
31
 
31
 
32
$revision =~ / ([\d\.]*) /;
32
$revision =~ / ([\d\.]*) /;
33
$version = $1;
33
$version = $1;
Line 37... Line 37...
37
## Used in Rdconv.pm and Rdlists.pm via $main::OSdir, and hence must not
37
## Used in Rdconv.pm and Rdlists.pm via $main::OSdir, and hence must not
38
## be lexical.  Argh.
38
## be lexical.  Argh.
39
$OSdir = $R::Vars::OSTYPE;
39
$OSdir = $R::Vars::OSTYPE;
40
## </NOTE>
40
## </NOTE>
41
 
41
 
42
my @knownoptions = ("debug|d", "type|t:s", "h|help", "v|version", 
42
my @knownoptions = ("debug|d", "type|t:s", "h|help", "v|version",
43
		    "o|output:s", "os|OS=s" => \$OSdir, "encoding=s");
43
		    "o|output:s", "os|OS=s" => \$OSdir, "encoding=s");
44
GetOptions (@knownoptions) || &usage();
44
GetOptions (@knownoptions) || &usage();
45
&R_version($name, $version) if $opt_v;
45
&R_version($name, $version) if $opt_v;
46
&usage() if $opt_h;
46
&usage() if $opt_h;
47
 
47
 
Line 59... Line 59...
59
my $enc = "unknown";
59
my $enc = "unknown";
60
$enc = $opt_encoding if $opt_encoding;
60
$enc = $opt_encoding if $opt_encoding;
61
 
61
 
62
my %types_and_exts = ("txt", "",
62
my %types_and_exts = ("txt", "",
63
		      "html", ".html",
63
		      "html", ".html",
64
		      "latex", ".tex",		      
64
		      "latex", ".tex",
65
		      "Sd", ".d",
65
		      "Sd", ".d",
66
		      "Ssgm", ".sgml",
66
		      "Ssgm", ".sgml",
67
		      "example", ".R");
67
		      "example", ".R");
68
 
68
 
69
my $opt_type_ok = 0;
69
my $opt_type_ok = 0;
Line 106... Line 106...
106
and 'example' (extract R code in the examples).
106
and 'example' (extract R code in the examples).
107
 
107
 
108
The default is to send output to stdout, which is also given by '-o -'.
108
The default is to send output to stdout, which is also given by '-o -'.
109
Using '-o ""' will choose an output filename by removing a '.Rd'
109
Using '-o ""' will choose an output filename by removing a '.Rd'
110
extension from FILE and adding a suitable extension.
110
extension from FILE and adding a suitable extension.
111
  
111
 
112
Email bug reports to <r-bugs\@r-project.org>.
112
Email bug reports to <r-bugs\@r-project.org>.
113
END
113
END
114
  exit 0;
114
  exit 0;
115
}
115
}
116
 
116