[Issue 20459] New: Runtime arg parsing should stop at '--'

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Dec 20 01:49:12 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=20459

          Issue ID: 20459
           Summary: Runtime arg parsing should stop at '--'
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: druntime
          Assignee: nobody at puremagic.com
          Reporter: pro.mathias.lang at gmail.com

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...).

--


More information about the Digitalmars-d-bugs mailing list