MCPcopy Create free account
hub / github.com/echoVic/blade-code / select

Method select

src/ui/components/Input.ts:90–111  ·  view source on GitHub ↗

* 单选列表

(
    message: string,
    choices: Choice[],
    options: SelectOptions = {}
  )

Source from the content-addressed store, hash-verified

88 * 单选列表
89 */
90 public static async select(
91 message: string,
92 choices: Choice[],
93 options: SelectOptions = {}
94 ): Promise<any> {
95 const answers = await inquirer.prompt([
96 {
97 type: 'list',
98 name: 'value',
99 message: UIStyles.component.label(message),
100 choices: choices.map(choice => ({
101 name: choice.name,
102 value: choice.value,
103 short: choice.short || choice.name,
104 disabled: choice.disabled,
105 })),
106 pageSize: 10,
107 ...options,
108 },
109 ]);
110 return answers.value;
111 }
112
113 /**
114 * 多选列表

Callers 3

quickSelectMethod · 0.95
mcpCommandFunction · 0.80
configCommandFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected