Re: How to get name of my application (project)

2019-08-05 Thread Jacob Carlborg via Digitalmars-d-learn
On 2019-08-03 17:58, Jonathan M Davis wrote: Also, the first element in the array passed to main is the name of the executable. No, what's passed to "main" is the path to however the application was invoked, not the executable. If you invoke it as "./foo" it will pass "./foo" to the "main"

Re: How to get name of my application (project)

2019-08-03 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, August 3, 2019 5:47:33 AM MDT Rémy Mouëza via Digitalmars-d- learn wrote: > On Saturday, 3 August 2019 at 09:26:03 UTC, Andrey wrote: > > Hello, how to get name of my application (project) that we > > write in dub.json? Is there any compile-time constant like > > __MODULE__? > > If I

Re: How to get name of my application (project)

2019-08-03 Thread James Blachly via Digitalmars-d-learn
On 8/3/19 5:26 AM, Andrey wrote: Hello, how to get name of my application (project) that we write in dub.json? Is there any compile-time constant like __MODULE__? Dear Andrey: Perhaps this is similar to what you are looking for: https://dlang.org/spec/grammar.html#SpecialKeyword

Re: How to get name of my application (project)

2019-08-03 Thread drug via Digitalmars-d-learn
03.08.2019 12:26, Andrey пишет: Hello, how to get name of my application (project) that we write in dub.json? Is there any compile-time constant like __MODULE__? You can get it using $DUB_PACKAGE from Environment variables (https://dub.pm/package-format-sdl), for example using

Re: How to get name of my application (project)

2019-08-03 Thread Bastiaan Veelo via Digitalmars-d-learn
On Saturday, 3 August 2019 at 09:26:03 UTC, Andrey wrote: Hello, how to get name of my application (project) that we write in dub.json? Is there any compile-time constant like __MODULE__? The name of an application is not a compile time constant: you can rename the executable at any time.

Re: How to get name of my application (project)

2019-08-03 Thread Rémy Mouëza via Digitalmars-d-learn
On Saturday, 3 August 2019 at 09:26:03 UTC, Andrey wrote: Hello, how to get name of my application (project) that we write in dub.json? Is there any compile-time constant like __MODULE__? If I understand the question correctly, you are looking for std.file.thisExePath: -