Closed shadowspawn closed 1 year 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).
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.
The README includes mention of a proposal for
process.mainsArgs
. Is there still interest in that as a separate proposal, or diminishing returns afterparseArgs
?I see two possible benefits from
process.mainArgs
:process.mainArgs
in author friendly way, compared withprocess.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 forparseArgs
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-533707724This 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