|
1 | 1 | import fs from 'node:fs' |
2 | 2 | import path from 'node:path' |
3 | 3 |
|
4 | | -import meow from 'meow' |
5 | | - |
6 | 4 | import { cmdManifestGradle } from './cmd-manifest-gradle.ts' |
7 | 5 | import { cmdManifestScala } from './cmd-manifest-scala.ts' |
8 | 6 | import { commonFlags } from '../../flags.ts' |
| 7 | +import { meowOrExit } from '../../utils/meow-with-subcommands' |
9 | 8 | import { getFlagListOutput } from '../../utils/output-formatting.ts' |
10 | 9 |
|
11 | 10 | import type { CliCommandConfig } from '../../utils/meow-with-subcommands' |
@@ -51,12 +50,11 @@ async function run( |
51 | 50 | importMeta: ImportMeta, |
52 | 51 | { parentName }: { parentName: string } |
53 | 52 | ): Promise<void> { |
54 | | - const cli = meow(config.help(parentName, config), { |
| 53 | + const cli = meowOrExit({ |
55 | 54 | argv, |
56 | | - description: config.description, |
| 55 | + config, |
57 | 56 | importMeta, |
58 | | - flags: config.flags, |
59 | | - allowUnknownFlags: false |
| 57 | + parentName |
60 | 58 | }) |
61 | 59 |
|
62 | 60 | const verbose = cli.flags['verbose'] ?? false |
@@ -93,24 +91,19 @@ async function run( |
93 | 91 | } |
94 | 92 |
|
95 | 93 | // Show new help screen and exit |
96 | | - meow( |
| 94 | + console.log( |
97 | 95 | ` |
98 | | - $ ${parentName} ${config.commandName} |
99 | | -
|
100 | | - Unfortunately this script did not discover a supported language in the |
101 | | - current folder. |
102 | | -
|
103 | | - - Make sure this script would work with your target build |
104 | | - - Make sure to run it from the correct folder |
105 | | - - Make sure the necessary build tools are available (\`PATH\`) |
106 | | -
|
107 | | - If that doesn't work, see \`${parentName} <lang> --help\` for config details for |
108 | | - your target language. |
109 | | - `, |
110 | | - { |
111 | | - argv: [], |
112 | | - description: config.description, |
113 | | - importMeta |
114 | | - } |
115 | | - ).showHelp() |
| 96 | +$ ${parentName} ${config.commandName} |
| 97 | +
|
| 98 | +Unfortunately this script did not discover a supported language in the |
| 99 | +current folder. |
| 100 | +
|
| 101 | +- Make sure this script would work with your target build |
| 102 | +- Make sure to run it from the correct folder |
| 103 | +- Make sure the necessary build tools are available (\`PATH\`) |
| 104 | +
|
| 105 | +If that doesn't work, see \`${parentName} <lang> --help\` for config details for |
| 106 | +your target language. |
| 107 | + `.trim() |
| 108 | + ) |
116 | 109 | } |
0 commit comments