(app: AppCommand)
| 137 | } |
| 138 | |
| 139 | async 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 | |
| 181 | function printVersion() { |
| 182 | console.log((globalThis as any).QWIK_VERSION); |
no test coverage detected
searching dependent graphs…