Version
v21.0.0-pre
Platform
Darwin MacBook-Pro-7.local 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:19:52 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T6000 arm64
Subsystem
No response
What steps will reproduce the bug?
Using the code below, it doesn't throw an error if the options are not provided.
// index.mjs
import { parseArgs } from 'node:util'
const { values } = parseArgs({
strict: true,
options: {
file: {
type: 'string',
short: 'f'
},
},
})
console.log('args:', values)
// args: [Object: null prototype] {}
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior? Why is that the expected behavior?
Should throw an error for both missing options and values
What do you see instead?
Only throw for missing values
Additional information
@nodejs/tooling
Version
v21.0.0-pre
Platform
Darwin MacBook-Pro-7.local 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:19:52 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T6000 arm64
Subsystem
No response
What steps will reproduce the bug?
Using the code below, it doesn't throw an error if the options are not provided.
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior? Why is that the expected behavior?
Should throw an error for both missing options and values
What do you see instead?
Only throw for missing values
Additional information
@nodejs/tooling