Nothing
Code
cli_menu_with_mock(1)
Message
Found multiple thingies.
Which one do you want to use?
1: label a
2: label b
3: label c
Selection: 1
Output
[1] 1
Code
cli_menu_with_mock("nope")
Condition
Error in `glue()`:
! could not find function "glue"
Code
out <- cli_menu_with_mock(c(1, 3))
Message
Found multiple thingies.
Which one do you want to use?
1: label 1
2: label 2
3: label 3
Selection: 1
Found multiple thingies.
Which one do you want to use?
1: label 1
2: label 2
3: label 3
Selection: 3
Code
cli_menu_with_mock(0)
Condition
Error in `glue()`:
! could not find function "glue"
Code
cli_menu_with_mock(1)
Message
Hey we need to talk.
What do you want to do?
1: Give up
2: Some other thing
Selection: 1
Condition
Error:
! Exiting...
Code
cli_menu_with_mock(2)
Message
Hey we need to talk.
What do you want to do?
1: Give up
2: Some other thing
Selection: 2
Output
[1] 2
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.