# -*- r -*-
module <- function(...){
  arglist <- as.list(match.call())
  ## change this from 'module' to 'r'
  arglist[1] <- 'r'
  args <- paste(arglist, collapse = ' ', sep = '')

  binary <- "@PKG@/libexec/lmod"

  cmd <- paste(binary, args, sep = ' ')

  hndl <- pipe(cmd)
  eval(expr = parse(file = hndl))
  close(hndl)

  invisible(0)
}
