mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-24 09:28:41 +00:00
21 lines
528 B
TypeScript
21 lines
528 B
TypeScript
import { cyan, magenta } from 'colorette'
|
|
import type { NuxtCommandMeta } from '../commands'
|
|
|
|
export function showHelp (meta?: Partial<NuxtCommandMeta>) {
|
|
const sections: string[] = []
|
|
|
|
if (meta) {
|
|
if (meta.usage) {
|
|
sections.push(magenta('> ') + 'Usage: ' + cyan(meta.usage))
|
|
}
|
|
|
|
if (meta.description) {
|
|
sections.push(magenta('⋮ ') + meta.description)
|
|
}
|
|
}
|
|
|
|
sections.push(`Use ${cyan('npx nuxi [command] --help')} to see help for each command`)
|
|
|
|
console.log(sections.join('\n\n') + '\n')
|
|
}
|