Skip to content

Commit b11de8d

Browse files
committed
Improve CLI argument handling
1 parent f7835b7 commit b11de8d

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/language/cli/input.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ export const handleInput = async <Result>(
1212
command: (input: JSONValueForbiddingSymbolicKeys) => Result,
1313
): Promise<Result> => {
1414
const args = parseArgs({
15-
args: process.argv,
16-
strict: false,
15+
args: process.argv.slice(2), // remove `execPath` and `filename`
1716
options: {
1817
'input-format': { type: 'string' },
1918
},

src/language/cli/output.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ export const handleOutput = async (
1010
command: () => Promise<Either<{ readonly message: string }, SyntaxTree>>,
1111
): Promise<undefined> => {
1212
const args = parseArgs({
13-
args: process.argv,
14-
strict: false,
13+
args: process.argv.slice(2), // remove `execPath` and `filename`
1514
options: {
1615
'output-format': { type: 'string' },
1716
},

0 commit comments

Comments
 (0)