Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw error when conflicting type params are passed #56

Open
ljharb opened this Issue Mar 9, 2019 · 5 comments

Comments

Projects
None yet
3 participants
@ljharb
Copy link
Contributor

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 referenced this issue Mar 9, 2019

Open

--type=auto #55

4 of 4 tasks complete

@GeoffreyBooth GeoffreyBooth added the bug label Mar 9, 2019

@GeoffreyBooth

This comment has been minimized.

Copy link
Contributor

GeoffreyBooth commented Mar 9, 2019

Examples:

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor 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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor

GeoffreyBooth commented Mar 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.