(args)
| 13 | static params = ['long'] |
| 14 | |
| 15 | async exec (args) { |
| 16 | if (!args.length) { |
| 17 | throw this.usageError() |
| 18 | } |
| 19 | |
| 20 | const docPath = path.resolve(this.npm.npmRoot, 'docs/content') |
| 21 | let files = await glob(`${globify(docPath)}/*/*.md`) |
| 22 | // preserve glob@8 behavior |
| 23 | files = files.sort((a, b) => a.localeCompare(b, 'en')) |
| 24 | const data = await this.readFiles(files) |
| 25 | const results = await this.searchFiles(args, data) |
| 26 | const formatted = this.formatResults(args, results) |
| 27 | if (!formatted.trim()) { |
| 28 | output.standard(`No matches in help for: ${args.join(' ')}\n`) |
| 29 | } else { |
| 30 | output.standard(formatted) |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | async readFiles (files) { |
| 35 | const res = {} |
nothing calls this directly
no test coverage detected