Skip to content

Commit 0e0c585

Browse files
committed
Fix cli parsing after real-world testing
These changes will be properly tested later. I just want to see the npm release cut a working binary first.
1 parent 0991488 commit 0e0c585

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/main.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ export function main(): void {
4040
yargs.positional('project', {
4141
type: 'string',
4242
default: '.',
43-
describe: 'the directory to index',
43+
describe:
44+
'path to the TypeScript project to index. Normally, this directory contains a tsconfig.json file.',
4445
})
45-
yargs.option('indexYarnWorkspaces', {
46+
yargs.option('yarnWorkspaces', {
4647
type: 'boolean',
4748
default: 'false',
4849
describe: 'whether to index all yarn workspaces',
@@ -54,8 +55,10 @@ export function main(): void {
5455
})
5556
},
5657
argv => {
57-
const workspaceRoot = argv.workspaceRoot as string
58-
const projects: string[] = argv.indexYarnWorkspaces
58+
const workspaceRoot = argv.project as string
59+
const yarnWorkspaces =
60+
typeof argv.yarnWorkspaces === 'boolean' && argv.yarnWorkspaces
61+
const projects: string[] = yarnWorkspaces
5962
? listYarnWorkspaces(workspaceRoot)
6063
: [workspaceRoot]
6164
const output = fs.openSync(argv.output as string, 'w')

0 commit comments

Comments
 (0)