Skip to content

Commit 09622e3

Browse files
author
smeyer
committed
tweak Rdconv --help and fix -o -
git-svn-id: https://svn.r-project.org/R/trunk@88276 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 99ca958 commit 09622e3

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

src/library/tools/R/Rd2pdf.R

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -413,27 +413,27 @@
413413
Usage <- function() {
414414
cat("Usage: R CMD Rdconv [options] FILE",
415415
"",
416-
"Convert R documentation in FILE to other formats such as plain text,",
416+
"Convert an R documentation (Rd) FILE to other formats such as plain text,",
417417
"HTML or LaTeX.",
418418
"",
419419
"Options:",
420-
" -h, --help print short help message and exit",
421-
" -v, --version print version info and exit",
422-
" -t, --type=TYPE convert to format TYPE",
423-
" --encoding=enc use 'enc' as the output encoding",
424-
" --package=pkg use 'pkg' as the package name",
425-
" -o, --output=OUT use 'OUT' as the output file",
426-
" --os=NAME assume OS 'NAME' (unix or windows)",
427-
" --OS=NAME the same as '--os'",
428-
" --RdMacros=pkglist",
429-
" packages from which to get Rd macros",
420+
" -h, --help print short help message and exit",
421+
" -v, --version print version info and exit",
422+
" -t, --type=TYPE convert to format TYPE",
423+
" --encoding=enc use 'enc' as the output encoding",
424+
" --package=pkg use 'pkg' as the package name",
425+
" -o, --output=OUT use 'OUT' as the output file",
426+
" --os=NAME assume OS 'NAME' (unix or windows)",
427+
" --OS=NAME the same as '--os'",
428+
" --RdMacros=pkglist packages from which to get Rd macros",
430429
"",
431430
"Possible format specifications are 'txt' (plain text), 'html', 'latex',",
432431
"and 'example' (extract R code in the examples).",
433432
"",
434433
"The default is to send output to stdout, which is also given by '-o -'.",
435-
"Using '-o \"\"' will choose an output filename by removing a '.Rd'",
436-
"extension from FILE and adding a suitable extension.",
434+
## Long-documented but never worked post-Perl (script args end at ""):
435+
## "Using '-o \"\"' will choose an output filename by removing a '.Rd'",
436+
## "extension from FILE and adding a suitable extension.",
437437
"",
438438
"Report bugs at <https://bugs.R-project.org>.", sep = "\n")
439439
}
@@ -495,12 +495,13 @@
495495
}
496496
if (length(files) != 1L)
497497
stop("exactly one Rd file must be specified", call. = FALSE)
498-
if (is.character(out) && !nzchar(out)) {
499-
## choose 'out' from filename
500-
bf <- sub("\\.[Rr]d$", "", file)
501-
exts <- c(txt=".txt", html=".html", latex=".tex", example=".R")
502-
out <- paste0(bf, exts[type])
503-
} else if (is.null(out)) out <- ""
498+
## if (is.character(out) && !nzchar(out)) {
499+
## ## choose 'out' from filename
500+
## bf <- sub("\\.[Rr]d$", "", files)
501+
## exts <- c(txt=".txt", html=".html", latex=".tex", example=".R")
502+
## out <- paste0(bf, exts[type])
503+
## } else
504+
if (is.null(out) || out == "-") out <- ""
504505
if (!nzchar(os)) os <- .Platform$OS.type
505506
macros <- initialRdMacros(pkglist = pkglist)
506507
switch(type,

0 commit comments

Comments
 (0)