MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / selectOne

Function selectOne

src/cli/interactive/prompts.ts:32–38  ·  view source on GitHub ↗
(opts: { options: SelectOption<T>[]; initialIndex?: number })

Source from the content-addressed store, hash-verified

30function createNonInteractivePrompter(): Prompter {
31 return {
32 async selectOne<T>(opts: { options: SelectOption<T>[]; initialIndex?: number }): Promise<T> {
33 if (opts.options.length === 0) {
34 throw new Error('No options available for selection.');
35 }
36 const index = clampIndex(opts.initialIndex ?? 0, opts.options.length);
37 return opts.options[index].value;
38 },
39 async selectMany<T>(opts: {
40 options: SelectOption<T>[];
41 initialSelectedKeys?: ReadonlySet<string>;

Callers

nothing calls this directly

Calls 2

clampIndexFunction · 0.85
handleCancelFunction · 0.85

Tested by

no test coverage detected