handle_input: Handler user input *[Experimental]*

View source: R/input.R

handle_inputR Documentation

Handler user input [Experimental]

Description

Handler user input [Experimental]

Usage

handle_input(
  input_fn = input_yes_no_again_exit,
  implications_fn = function(answer) { },
  type = c("inner", "outer"),
  envir = parent.frame(),
  is_interactive = interactive()
)

Arguments

input_fn

(function) Function to capture user input

implications_fn

(function) Function to execute implications. Should semantically "match" the input function

type

(character) See clix::::handle_input_

TODO-20220201-1620: check what 'inner' and 'outer' actually does - too long ago ;-)

envir

(environment) The environment in which to evaluate expression.

is_interactive

[logical] Interactive mode yes/no

Examples

handle_input(
    input_fn = input_yes_no_again_exit,
    implications_fn = purrr::partial(
        .f = function(input) {
            if (input) {
                message("Yes")
            } else {
                message("No")
            }
        }
    )
)

rappster/clix documentation built on Aug. 16, 2022, 9:54 p.m.