pkgjs / parseargs

Polyfill of `util.parseArgs()`
Apache License 2.0
121 stars 9 forks source link

What is happening with process.mainArgs? #128

Closed shadowspawn closed 1 year ago

shadowspawn commented 2 years ago

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:

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 (https://github.com/pkgjs/parseargs/issues/84#issuecomment-1079844389, https://github.com/pkgjs/parseargs/issues/84#issuecomment-1079845732, https://github.com/pkgjs/parseargs/issues/84#issuecomment-1138767730).


I think process.mainArgs was first suggested in argument parsing thread: https://github.com/nodejs/tooling/issues/19#issuecomment-533707724

This later comment follows up on a meeting and agrees with dropping process.mainArgs and focus on argument parsing : https://github.com/nodejs/tooling/issues/19#issuecomment-573771185

bakkot commented 2 years ago

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 commented 1 year ago

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.