Skip to content
This repository was archived by the owner on Apr 16, 2020. It is now read-only.

Throw error when conflicting type params are passed #56

Closed
ljharb opened this issue Mar 9, 2019 · 6 comments
Closed

Throw error when conflicting type params are passed #56

ljharb opened this issue Mar 9, 2019 · 6 comments

Comments

@ljharb
Copy link
Member

ljharb commented Mar 9, 2019

Per #55 (comment)

An error should be thrown if:

  • more than one --type is passed
  • any alias for a --type value is passed along with any --type value
  • multiple aliases for a --type value are passed
@ljharb ljharb mentioned this issue Mar 9, 2019
4 tasks
@GeoffreyBooth GeoffreyBooth added the bug Something isn't working label Mar 9, 2019
@GeoffreyBooth
Copy link
Member

Examples:

node --experimental-modules --type=commonjs --type=module file.js
node --experimental-modules --type=commonjs -m file.js

@devsnek
Copy link
Member

devsnek commented Mar 9, 2019

getting rid of -m would help so that its more obvious when you've duplicated the flag.

aside from that, node in general just allows duplicated flags.

node --title=1 --title=2
> process.title
'2'

this is particularly important because it means you can override things from NODE_OPTIONS

@ljharb
Copy link
Member Author

ljharb commented Mar 9, 2019

@devsnek allowing duplicate flags isn’t necessary to allow overriding; but it may be that node’s options parser lacks the capability to properly distinguish them.

@devsnek
Copy link
Member

devsnek commented Mar 9, 2019

@ljharb my point is more that this isn't an issue specific to --type (although -m is unique in that its the only short flag which can "disagree" with a longer flag). perhaps someone could raise this issue upstream?

@GeoffreyBooth
Copy link
Member

cc @addaleax

@GeoffreyBooth
Copy link
Member

Resolved in #45

@GeoffreyBooth GeoffreyBooth removed the bug Something isn't working label Apr 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants