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

What is happening with process.mainArgs? #128

Closed
shadowspawn opened this issue May 27, 2022 · 2 comments
Closed

What is happening with process.mainArgs? #128

shadowspawn opened this issue May 27, 2022 · 2 comments

Comments

@shadowspawn
Copy link
Collaborator

The README includes mention of a proposal for process.mainsArgs. Is there still interest in that as a separate proposal, or diminishing returns after parseArgs?

I see two possible benefits from process.mainArgs:

  • supplying arguments to other argument parsers, explicitly by library user or implicitly in library implementation
  • potential for things building on Node.js to support process.mainArgs in author friendly way, compared with process.argv which sometimes breaks Node.js conventions (e.g. Electron, zx). This is a speculative benefit which may not eventuate!

If process.mainArgs is unlikely, then it is a decision for parseArgs alone whether to expose the implicit args in context of richer parsing information (#84 (comment), #84 (comment), #84 (comment)).


I think process.mainArgs was first suggested in argument parsing thread: nodejs/tooling#19 (comment)

This later comment follows up on a meeting and agrees with dropping process.mainArgs and focus on argument parsing : nodejs/tooling#19 (comment)

@bakkot
Copy link
Collaborator

bakkot commented May 28, 2022

I see two possible benefits from process.mainArgs:

There's another benefit specifically for parseArgs, which is that sometimes you want to do some preprocessing before passing arguments to parseArgs. For example, some utilities will want to slice off everything after -- and treat those values as something other than positionals (e.g. to be forwarded to another program).

@shadowspawn
Copy link
Collaborator Author

This hasn't got additional interest (thanks for comment @bakkot) and isn't likely to get championed out of this project. The Tooling Group is a more likely place to gather interest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants