check_cltool: Check availability and version of a command-line tool

Description Usage Arguments Value See Also

View source: R/Miscellaneous_Functions.R

Description

The function throws an error if the command-line tool cannot be run and its version queried by a call to system2. Otherwise, the function compares the return version value with the argument v_expected. If it does not match and the argument stop_on_mismatch has a TRUE value, then an error is thrown with a suitable message; otherwise, a warning is issued.

Usage

1
check_cltool(tool, v_expected, stop_on_mismatch = FALSE)

Arguments

tool

A character string. The name of the command-line tool.

v_expected

A character string that is or can be converted to represent the expected version of the command-line tool.

stop_on_mismatch

A logical value.

Value

An invisible TRUE.

See Also

system2


DrylandEcology/rSFSW2 documentation built on Aug. 18, 2020, 1:27 p.m.