Bug 20459 – Runtime arg parsing should stop at '--'
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-12-20T01:49:12Z
Last change time
2019-12-26T10:16:38Z
Keywords
pull
Assigned to
No Owner
Creator
Mathias LANG
Comments
Comment #0 by pro.mathias.lang — 2019-12-20T01:49:12Z
Currently runtime argument parsing (--DRT-gcopt for example) does not stop at the POSIX-recommended value (double dash, '--').
There is a way to disable argument parsing completely (https://github.com/dlang/druntime/pull/2375) but no way to write a program that would take arguments that are passed to a child, like `dub` or `rdmd` do.
The three possible cases, using dub as an example, are:
- dub --DRT-gcopt:whatever -- ProgramArguments (Configure dub)
- dub -- --DRT-gcopt:whatever ProgramArguments (Configure the package)
- dub --DRT-gcopt:whatever -- --DRT-gcopt:whatever ProgramArguments (Configure both)
Note that this approach isn't fully perfect: It assumes the program will use `--` itself, which might not be true, but it's an improvement over what we currently have.
Another option I could see is to provide a hook for argument parsing to programs instead of adding those booleans (rt_cmdline_enabled, rt_envvars_enabled, etc...).
Comment #1 by dlang-bot — 2019-12-23T06:23:53Z
@Geod24 created dlang/druntime pull request #2881 "Fix issue 20459 - Runtime arg parsing should stop at POSIX delimiter" fixing this issue:
- Fix issue 20459 - Runtime arg parsing should stop at POSIX delimiter
This makes druntime argument parsing consistent with the behavior of
options on POSIX systems.
It also ensures that druntime argument can be passed down to other programs,
e.g. for 'dub' and 'rdmd'.
https://github.com/dlang/druntime/pull/2881
Comment #2 by dlang-bot — 2019-12-26T10:16:38Z
dlang/druntime pull request #2881 "Fix issue 20459 - Runtime arg parsing should stop at POSIX delimiter" was merged into master:
- 2f59e46c43afa996a68eaa52cdf4a4b27e619c98 by Geod24:
Fix issue 20459 - Runtime arg parsing should stop at POSIX delimiter
This makes druntime argument parsing consistent with the behavior of
options on POSIX systems.
It also ensures that druntime argument can be passed down to other programs,
e.g. for 'dub' and 'rdmd'.
https://github.com/dlang/druntime/pull/2881