R/options.R

Defines functions get.suppressEchoCmdInFuncOption set.suppressEchoCmdInFuncOption get.defaultFlagsOption set.defaultFlagsOption get.legacyExecOption set.legacyExecOption get.useInternOption set.useInternOption get.echoCmdOption set.echoCmdOption get.stop_on_no_flags_parasOption set.stop_on_no_flags_parasOption get.ignore.stderrOption set.ignore.stderrOption

Documented in get.defaultFlagsOption get.echoCmdOption get.ignore.stderrOption get.legacyExecOption get.stop_on_no_flags_parasOption get.suppressEchoCmdInFuncOption get.useInternOption set.defaultFlagsOption set.echoCmdOption set.ignore.stderrOption set.legacyExecOption set.stop_on_no_flags_parasOption set.suppressEchoCmdInFuncOption set.useInternOption

# Interpreted GRASS 7 interface functions
# Copyright (c) 2015 Roger S. Bivand
#
# needed
set.ignore.stderrOption <- function(value) {
  if (!is.logical(value)) stop("logical argument required")
  res <- get("ignore.stderr", envir = .GRASS_CACHE)
  assign("ignore.stderr", value, envir = .GRASS_CACHE)
  res
}

get.ignore.stderrOption <- function() {
  get("ignore.stderr", envir = .GRASS_CACHE)
}
# needed
set.stop_on_no_flags_parasOption <- function(value) {
  if (!is.logical(value)) stop("logical argument required")
  res <- get("stop_on_no_flags_paras", envir = .GRASS_CACHE)
  assign("stop_on_no_flags_paras", value, envir = .GRASS_CACHE)
  res
}

get.stop_on_no_flags_parasOption <- function() {
  get("stop_on_no_flags_paras", envir = .GRASS_CACHE)
}

set.echoCmdOption <- function(value) {
  if (!is.logical(value)) stop("logical argument required")
  res <- get("echoCmd", envir = .GRASS_CACHE)
  assign("echoCmd", value, envir = .GRASS_CACHE)
  res
}

get.echoCmdOption <- function() {
  get("echoCmd", envir = .GRASS_CACHE)
}

set.useInternOption <- function(value) {
  if (!is.logical(value)) stop("logical argument required")
  res <- get("useIntern", envir = .GRASS_CACHE)
  assign("useIntern", value, envir = .GRASS_CACHE)
  res
}

get.useInternOption <- function() {
  get("useIntern", envir = .GRASS_CACHE)
}

set.legacyExecOption <- function(value) {
  if (!is.logical(value)) stop("logical argument required")
  res <- get("legacyExec", envir = .GRASS_CACHE)
  assign("legacyExec", value, envir = .GRASS_CACHE)
  res
}

get.legacyExecOption <- function() {
  get("legacyExec", envir = .GRASS_CACHE)
}

set.defaultFlagsOption <- function(value) {
  res <- get("defaultFlags", envir = .GRASS_CACHE)
  if (is.null(value)) {
    assign("defaultFlags", value, envir = .GRASS_CACHE)
  } else {
    if (!is.character(value)) stop("character argument required")
    stopifnot(length(value) > 0)
    stopifnot(all(value %in% c("quiet", "verbose")))
    assign("defaultFlags", value, envir = .GRASS_CACHE)
  }
  res
}

get.defaultFlagsOption <- function() {
  get("defaultFlags", envir = .GRASS_CACHE)
}

set.suppressEchoCmdInFuncOption <- function(value) {
  if (!is.logical(value)) stop("logical argument required")
  res <- get("suppressEchoCmdInFunc", envir = .GRASS_CACHE)
  assign("suppressEchoCmdInFunc", value, envir = .GRASS_CACHE)
  res
}

get.suppressEchoCmdInFuncOption <- function() {
  get("suppressEchoCmdInFunc", envir = .GRASS_CACHE)
}

Try the rgrass package in your browser

Any scripts or data that you put into this service are public.

rgrass documentation built on June 22, 2024, 9:48 a.m.