#1101089 gdmd -run -f... / -main -unittest options does not work?

#1101089#5
Date:
2025-03-23 03:13:36 UTC
From:
To:
According to the man page -f... options should be passed to gdc.


But:

$ head -1 foo.d
#!/usr/bin/env -S gdmd -run -fmain -fpreview=all -unittest

$ strace -f ./foo.d 2>&1 | grep execve
...
...
execve("/usr/bin/gdc", [""/usr/bin/gdc", "-c", "-main", "-o", "-main.o"]


I had similar issue with not quite documented -main (it works different
than the generic -m... flag passing), which are mentioned in the source
code of gdmd tho.

Digging deeper, and experimenting, it looks like -run must be the last
parameter passed? (Not mentioned in the man page).