Open wilzbach opened 10 years ago
Comment author: Nils <nilsbossung@googlemail.com>
When rdmd is used to sort-of interpret a .d file, it's actually compiled to a temporary executable and then run. As usual, args[0] is then the temporary executable. That path is next to useless, though.
Other interpreters (bash, python, perl, php) pass the script file as args[0]. This allows to write scripts that act relative to the script file, no matter from where they were run.
Would be nice if rdmd did that, too. This would be a breaking change, of course. But I can't imagine someone making use of the path to the temporary.
Compare with bash, python, perl, php:
Note: the issue was created automatically migrated from https://issues.dlang.org
Original bug ID: BZ#13347 From: Nils <nilsbossung@googlemail.com> Reported version: D2