R/utils.R

## helpers from BiocManager
.getAnswer <- function(msg, allowed)
{
    if (interactive()) {
        repeat {
            cat(msg)
            answer <- readLines(n = 1)
            if (answer %in% allowed)
                break
        }
        tolower(answer)
    } else {
        "n"
    }
}

.msg <-
    function(fmt, ..., width = getOption("width"))
{
    txt <- strwrap(sprintf(fmt, ...), width = width, exdent = 2)
    paste(txt, collapse = "\n")
}

.message <-
    function(..., appendLF=TRUE)
{
    message(.msg(...), appendLF=appendLF)
    invisible(TRUE)
}
waldronlab/cacheur documentation built on June 16, 2019, 5:06 p.m.