Re: crash on args.getopt

2015-01-25 Thread FG via Digitalmars-d-learn
On 2015-01-25 at 11:42, Tobias Pankrath wrote: On Sunday, 25 January 2015 at 10:21:34 UTC, Suliman wrote: But is it good practice to fail with exception during passing unknown parameters? Maybe std.getopt.config.passThrough should be as default? I really can't remember Apps that crush if pass

Re: crash on args.getopt

2015-01-25 Thread Tobias Pankrath via Digitalmars-d-learn
On Sunday, 25 January 2015 at 10:21:34 UTC, Suliman wrote: But is it good practice to fail with exception during passing unknown parameters? Maybe std.getopt.config.passThrough should be as default? I really can't remember Apps that crush if pass to in unknown parameters. Almost all program

Re: crash on args.getopt

2015-01-25 Thread Suliman via Digitalmars-d-learn
But is it good practice to fail with exception during passing unknown parameters? Maybe std.getopt.config.passThrough should be as default? I really can't remember Apps that crush if pass to in unknown parameters.

Re: crash on args.getopt

2015-01-24 Thread ketmar via Digitalmars-d-learn
On Sun, 25 Jan 2015 05:34:15 +, Suliman wrote: > Ali, you are right it's my error: > > getopt( >args, > > and I did: > args.getopt ( > args, > > > Am I right understand that "args" in "args.getopt" is UFCS syntax style? just a minor detail: "UFCS style", as "S" un "UFCS" means "syntax

Re: crash on args.getopt

2015-01-24 Thread ketmar via Digitalmars-d-learn
On Sun, 25 Jan 2015 05:34:15 +, Suliman wrote: > Ali, you are right it's my error: > > getopt( >args, > > and I did: > args.getopt ( > args, > > > Am I right understand that "args" in "args.getopt" is UFCS syntax style? exactly. signature.asc Description: PGP signature

Re: crash on args.getopt

2015-01-24 Thread Suliman via Digitalmars-d-learn
Ali, you are right it's my error: getopt( args, and I did: args.getopt ( args, Am I right understand that "args" in "args.getopt" is UFCS syntax style?

Re: crash on args.getopt

2015-01-24 Thread Ali Çehreli via Digitalmars-d-learn
On 01/24/2015 11:39 AM, Suliman wrote: > First of all it's seems bug in docs: > void main(string[] args) > { >getopt( > args, > "length", &length,// numeric > "file",&data, // string > "verbose", &verbose, // flag > "color", &color);// enum >

Re: crash on args.getopt

2015-01-24 Thread ketmar via Digitalmars-d-learn
On Sat, 24 Jan 2015 19:55:10 +, Suliman wrote: >> Look for "Passing unrecognized options through" in the documentation. > Oh I see, but first part of question is still actual. > > And also what is benefits of using getopt instead of parsing args[] > manually? well... you can skip writing cus

Re: crash on args.getopt

2015-01-24 Thread Suliman via Digitalmars-d-learn
Look for "Passing unrecognized options through" in the documentation. Oh I see, but first part of question is still actual. And also what is benefits of using getopt instead of parsing args[] manually?

Re: crash on args.getopt

2015-01-24 Thread Tobias Pankrath via Digitalmars-d-learn
http://dlang.org/phobos/std_getopt.html But problem that I do not know how handle not existing values: void main(string[] args) { args.getopt ( "help", &help ); } app.exe -sss causes crash: std.getopt.GetOptException@C:\D\dmd2\windows\bin\..\..\src\phobos

crash on args.getopt

2015-01-24 Thread Suliman via Digitalmars-d-learn
First of all it's seems bug in docs: void main(string[] args) { getopt( args, "length", &length,// numeric "file",&data, // string "verbose", &verbose, // flag "color", &color);// enum ... } with args inside getopt I am getting: C:\D\dmd2\windows\bin\