MCPcopy
hub / github.com/QwikDev/qwik / printHelp

Function printHelp

packages/qwik/src/cli/run.ts:139–179  ·  view source on GitHub ↗
(app: AppCommand)

Source from the content-addressed store, hash-verified

137}
138
139async function printHelp(app: AppCommand) {
140 const pmRun = pmRunCmd();
141
142 intro(`🔭 ${bgMagenta(' Qwik Help ')}`);
143
144 note(
145 COMMANDS.filter((cmd) => cmd.showInHelp)
146 .map(
147 (cmd) =>
148 `${pmRun} qwik ${cyan(cmd.label)}` +
149 ' '.repeat(Math.max(SPACE_TO_HINT - cmd.label.length, 2)) +
150 dim(cmd.hint)
151 )
152 .join('\n'),
153 'Available commands'
154 );
155
156 const proceed = await confirm({
157 message: 'Do you want to run a command?',
158 initialValue: true,
159 });
160
161 if (isCancel(proceed) || !proceed) {
162 bye();
163 }
164
165 const command = await select({
166 message: 'Select a command',
167 options: COMMANDS.filter((cmd) => cmd.showInHelp).map((cmd) => ({
168 value: cmd.value,
169 label: `${pmRun} qwik ${cyan(cmd.label)}`,
170 hint: cmd.hint,
171 })),
172 });
173
174 if (isCancel(command)) {
175 bye();
176 }
177 const args = (command as string).split(' ');
178 await runCommand(Object.assign(app, { task: args[0], args }));
179}
180
181function printVersion() {
182 console.log((globalThis as any).QWIK_VERSION);

Callers 2

run.tsFile · 0.85
runCommandFunction · 0.85

Calls 5

pmRunCmdFunction · 0.90
noteFunction · 0.90
byeFunction · 0.90
runCommandFunction · 0.70
joinMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…