Title: | Execute Command Line Programs Interactively |
---|---|
Description: | Execute command line programs and format results for interactive use. It is based on the package 'processx' so it does not use shell to start up the process like system() and system2(). It also provides a simpler and cleaner interface than processx::run(). |
Authors: | Randy Lai [aut, cre, cph] |
Maintainer: | Randy Lai <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.2.9999 |
Built: | 2025-01-26 04:40:25 UTC |
Source: | https://github.com/randy3k/cliff |
Run a command line program and wait until it terminates.
run( command, ..., input = NULL, error_on_status = TRUE, stderr_to_stdout = FALSE, wd = NULL, timeout = Inf, env = NULL )
run( command, ..., input = NULL, error_on_status = TRUE, stderr_to_stdout = FALSE, wd = NULL, timeout = Inf, env = NULL )
command |
the command to run |
... |
the arguments pass to the program, supports the
big bang operator |
input |
text pass to stdin |
error_on_status |
raise an error if return code is not 0. |
stderr_to_stdout |
whether stderr should be forwarded to stdout. |
wd |
working directory |
timeout |
throw an error after this amount of time in second |
env |
additional environment variables |
The stdout of the program in a scalar character.
It may contain a trailing newline. Use trimws()
to
ensure the trailing newline is trimmed.
## Not run: git <- function(...) cliff::run("git", ...) git("log", git("rev-parse", "--abbrev-ref", "HEAD"), "-n1") ## End(Not run)
## Not run: git <- function(...) cliff::run("git", ...) git("log", git("rev-parse", "--abbrev-ref", "HEAD"), "-n1") ## End(Not run)