Function interactor::pick_from_list [] [src]

pub fn pick_from_list<T: AsRef<str>>(
    cmd: Option<&mut Command>,
    items: &[T],
    prompt: &str
) -> Result<String>

Asks the user to select an item from a list.

If cmd is Some, an external menu program will be used.
Otherwise, a built-in simple number-based command-line menu (on /dev/tty) will be used, with a prompt.

Note: an external program might return something that's not in the list!