choose method

MenuResult<T> choose()

Lists the options and lets user choose, then returns the result. This is a blocking operation.

Returns the MenuResult.

Implementation

MenuResult<T> choose() {
  _SimpleResult result;
  if (_useAnsi) {
    result = _chooseAnsi();
  } else {
    result = _chooseNonAnsi();
  }

  return MenuResult(
    result.index,
    _options[result.index],
    modifierKey: result.modifierKey,
  );
}