Skip to content

Commit b0dc375

Browse files
committed
make Option#name returned by popOption() unformatted
1 parent c4f2e12 commit b0dc375

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/bin/hsm.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ switch (commands[0]) {
246246
if (dtsPathOption) {
247247
if (typeof dtsPathOption.value != `string`) {
248248
logError(
249-
`Option ${colourN(dtsPathOption.name)} must be a string, got ${colourV(dtsPathOption.value)
249+
`Option ${formatOption(dtsPathOption.name)} must be a string, got ${colourV(dtsPathOption.value)
250250
}\n`
251251
)
252252

@@ -302,7 +302,7 @@ ${colourN(`--hackmud-path`)}=${colourB(`<path>`)} option or ${colourN(`HSM_HACKM
302302

303303
if (dtsPathOption && dtsPathOption.name != `dts-path` && dtsPathOption.name != `type-declaration-path`) {
304304
console.warn(colourF(`\
305-
Warning: ${colourN(dtsPathOption.name)} is being deprecated and will be removed in the
305+
Warning: ${formatOption(dtsPathOption.name)} is being deprecated and will be removed in the
306306
next minor release of HSM
307307
You should switch to using its alias ${colourN(`--dts-path`)}\n`
308308
))
@@ -643,10 +643,8 @@ function popOption(...names: string[]): Option | undefined {
643643
if (!presentOptionNames.length)
644644
return undefined
645645

646-
const presentOptionNamesWithDashDash = presentOptionNames.map(formatOption)
647-
648646
if (presentOptionNames.length > 1) {
649-
logError(`The options ${presentOptionNamesWithDashDash.join(`, `)
647+
logError(`The options ${presentOptionNames.map(formatOption).join(`, `)
650648
} are aliases for each other. Please only specify one`)
651649

652650
process.exit(1)
@@ -656,7 +654,7 @@ function popOption(...names: string[]): Option | undefined {
656654

657655
options.delete(presentOptionNames[0]!)
658656

659-
return { name: presentOptionNamesWithDashDash[0]!, value }
657+
return { name: presentOptionNames[0]!, value }
660658
}
661659

662660
function complainAboutUnrecognisedOptions(): void {

0 commit comments

Comments
 (0)