Re: implementing --version?

2016-11-22 Thread mab-on via Digitalmars-d-learn
Thanks! These tips are exactly what i needed :)

Re: implementing --version?

2016-11-21 Thread Jacob Carlborg via Digitalmars-d-learn
On 2016-11-21 22:32, mab-on wrote: On Monday, 21 November 2016 at 20:56:41 UTC, Karabuta wrote: There is a package in the dub registry called commando (https://code.dlang.org/packages/commando) for that. Hm.. maybe i explained it wrong. My problem is not to pass a argument to the

Re: implementing --version?

2016-11-21 Thread Meta via Digitalmars-d-learn
On Tuesday, 22 November 2016 at 00:41:42 UTC, Meta wrote: You could write a little script to generate an increasing version and save it in a file. Then with Dub you can use a pre-build or pre-generate command to call that script, and in your D code do `enum version = import("version.txt");`.

Re: implementing --version?

2016-11-21 Thread Meta via Digitalmars-d-learn
On Monday, 21 November 2016 at 21:32:16 UTC, mab-on wrote: On Monday, 21 November 2016 at 20:56:41 UTC, Karabuta wrote: There is a package in the dub registry called commando (https://code.dlang.org/packages/commando) for that. Hm.. maybe i explained it wrong. My problem is not to pass a

Re: implementing --version?

2016-11-21 Thread Basile B. via Digitalmars-d-learn
On Monday, 21 November 2016 at 23:46:41 UTC, Basile B. wrote: On Monday, 21 November 2016 at 21:32:16 UTC, mab-on wrote: What i want is a clever mechanism to store the SemVer (or Commit-ID) in the binary at compiletime - automatically. Otherwise i have to think to update a const in the code

Re: implementing --version?

2016-11-21 Thread Basile B. via Digitalmars-d-learn
On Monday, 21 November 2016 at 21:32:16 UTC, mab-on wrote: What i want is a clever mechanism to store the SemVer (or Commit-ID) in the binary at compiletime - automatically. Otherwise i have to think to update a const in the code every time i build a new Version. enum versionData =

Re: implementing --version?

2016-11-21 Thread mab-on via Digitalmars-d-learn
On Monday, 21 November 2016 at 20:56:41 UTC, Karabuta wrote: There is a package in the dub registry called commando (https://code.dlang.org/packages/commando) for that. Hm.. maybe i explained it wrong. My problem is not to pass a argument to the application. What i want is a clever

Re: implementing --version?

2016-11-21 Thread Karabuta via Digitalmars-d-learn
On Monday, 21 November 2016 at 19:33:54 UTC, mab-on wrote: I would like to implement a "--version" switch for a command line application. Is there a clever way to do that without using the brain on every build? :) A dub-solution would be nice - but i didnt find it. There is a package in the

implementing --version?

2016-11-21 Thread mab-on via Digitalmars-d-learn
I would like to implement a "--version" switch for a command line application. Is there a clever way to do that without using the brain on every build? :) A dub-solution would be nice - but i didnt find it.