Re: Allowing string value with getopt without requiring it

2013-12-13 Thread H. S. Teoh
On Fri, Dec 13, 2013 at 10:46:57AM +0100, John Colvin wrote: > On Friday, 13 December 2013 at 01:51:25 UTC, Ithy wrote: > >Hello. I'm just getting into D (literally writing my first > >program), and I can't figure out how to do this with getopt: > > > >I want to have the option --log, which will en

Re: Allowing string value with getopt without requiring it

2013-12-13 Thread John Colvin
On Friday, 13 December 2013 at 01:51:25 UTC, Ithy wrote: Hello. I'm just getting into D (literally writing my first program), and I can't figure out how to do this with getopt: I want to have the option --log, which will enable logging (set a bool variable to true). However, I want the program

Allowing string value with getopt without requiring it

2013-12-12 Thread Ithy
Hello. I'm just getting into D (literally writing my first program), and I can't figure out how to do this with getopt: I want to have the option --log, which will enable logging (set a bool variable to true). However, I want the program to also accept --log=filename to allow the user to defin