Skip to content

Commit 59f5e43

Browse files
committed
Pass on flag options to meow proper, fixing boolean flags
1 parent 3a79c58 commit 59f5e43

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/commands/manifest/scala.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type ListDescription =
1919
const renamep = util.promisify(fs.rename)
2020

2121
const description =
22-
'Generate a manifest file (`pom.xml`) from Scala\'s `build.sbt` file'
22+
"Generate a manifest file (`pom.xml`) from Scala's `build.sbt` file"
2323

2424
const scalaCmdFlags: Record<string, ListDescription> = {
2525
bin: {
@@ -88,8 +88,10 @@ export const scala: CliSubcommand = {
8888
const name = `${parentName} scala`
8989
// note: meow will exit if it prints the --help screen
9090
const cli = meow(help(name, scalaCmdFlags), {
91+
flags: <{ [key: string]: any }>scalaCmdFlags,
9192
argv: argv.length === 0 ? ['--help'] : argv,
9293
description,
94+
allowUnknownFlags: false,
9395
importMeta
9496
})
9597

@@ -98,7 +100,6 @@ export const scala: CliSubcommand = {
98100
}
99101

100102
const target = cli.input[0]
101-
102103
if (!target) {
103104
// will exit.
104105
new Spinner()
@@ -172,7 +173,7 @@ async function startConversion(
172173
console.log(`[VERBOSE] - Absolute target path: \`${rtarget}\``)
173174
console.log(`[VERBOSE] - Absolute out path: \`${rout}\``)
174175
} else {
175-
console.log(`- executing: \`${bin}\``);
176+
console.log(`- executing: \`${bin}\``)
176177
console.log(`- src dir: \`${target}\``)
177178
console.log(`- dst dir: \`${out}\``)
178179
}
@@ -199,9 +200,9 @@ async function startConversion(
199200
spinner.error('There were errors while running sbt')
200201
// (In verbose mode, stderr was printed above, no need to repeat it)
201202
if (!verbose) {
202-
console.group('[VERBOSE] stderr:');
203+
console.group('[VERBOSE] stderr:')
203204
console.error(output.stderr)
204-
console.groupEnd();
205+
console.groupEnd()
205206
}
206207
process.exit(1)
207208
}
@@ -234,11 +235,14 @@ async function startConversion(
234235
spinner.start().success(`OK. File should be available in \`${out}\``)
235236
}
236237
} catch (e) {
237-
spinner.error('There was an unexpected error while running this' + (verbose ? '' : ' (use --verbose for details)'))
238+
spinner.error(
239+
'There was an unexpected error while running this' +
240+
(verbose ? '' : ' (use --verbose for details)')
241+
)
238242
if (verbose) {
239-
console.group('[VERBOSE] error:');
243+
console.group('[VERBOSE] error:')
240244
console.log(e)
241-
console.groupEnd();
245+
console.groupEnd()
242246
}
243247
process.exit(1)
244248
}

0 commit comments

Comments
 (0)