Re: How to pass Compile Time info to source files

2016-08-27 Thread UDW via Digitalmars-d-learn

On Sunday, 28 August 2016 at 02:51:13 UTC, Adam D. Ruppe wrote:
The filename passed to the compiler is easy: __FILE__ works in 
D too, and you can just strip off extra path info with ordinary 
functions (like std.path's basename or dirname functions).


Thanks Adam. Worked like a charm.


Re: How to pass Compile Time info to source files

2016-08-27 Thread UDW via Digitalmars-d-learn
Whoops. Forgot to mention that I don't need the path truncation 
just the info that is exposed by the compiler or build system to 
source files at compile time and how to retrieve it.


Thank you in advance :)


How to pass Compile Time info to source files

2016-08-27 Thread UDW via Digitalmars-d-learn

Hi,

I would like to know how to do something like this

http://stackoverflow.com/questions/237542/learning-the-source-codes-filename-at-compile-time

using dmd or dub.
Can somebody point me in the direction of the doco for this 
please because I can't find it :(


ty ss



Re: Command Line Utility Library

2016-08-16 Thread UDW via Digitalmars-d-learn
On Tuesday, 16 August 2016 at 07:19:18 UTC, Edwin van Leeuwen 
wrote:

I am using:
http://code.dlang.org/packages/docopt

It's not really json configurable, but that shouldn't be to 
complex to implement yourself.


That's also very nice. I hadn't thought of writing the help text 
first and then having a parser for the usage to generate options.

Much appreciated.

On Tuesday, 16 August 2016 at 01:46:53 UTC, Seb wrote:

Have you had a detailed look at std.getopt?
https://dlang.org/phobos/std_getopt.html

That's very similar to commander.js ;-)


I shall reread the std.getopt doco.

ty ss :)


Re: Command Line Utility Library

2016-08-15 Thread UDW via Digitalmars-d-learn

On Monday, 15 August 2016 at 10:48:11 UTC, Seb wrote:


Are you trying to parse arguments?
There's a lot of good stuff for it already:

https://dlang.org/phobos/std_getopt.html
https://code.dlang.org/packages/darg
https://blog.thecybershadow.net/2014/08/05/ae-utils-funopt/


For configuration files:

https://code.dlang.org/packages/onyx-config
https://code.dlang.org/packages/inid
https://code.dlang.org/packages/yamkeys
https://code.dlang.org/packages/runtimer
https://code.dlang.org/packages/variantconfig


Thanks for the suggestions Seb,
https://blog.thecybershadow.net/2014/08/05/ae-utils-funopt/
looks very nice :).

I just thought there would be a standard library, stdclib, phobos 
or otherwise for making CLI tools that would generate 
sub-commands, options, help text and handle input for it all. 
Unfortunately my gumby searching didn't find much yesterday. Sort 
of like this

https://github.com/tj/commander.js
which I found after a bit more searching.

ty again


Command Line Utility Library

2016-08-15 Thread UDW via Digitalmars-d-learn

Hi,

I would like some options for a library, preferably json 
configurable, that helps with command line tool development. 
Doesn't have to be in D specifically.



Currently I am using using std.getopt. I had a search in the DUB 
repos and in github but didn't really find anything appealing.


ty ss <3