hemprasad / gflags

Automatically exported from code.google.com/p/gflags
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Could you call once validatefunc for each occurrence of flag on terminal(cmd)? #66

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I register an Validator for my flag,like this:
static const bool nonused = google::RegisterFlagValidator(&myflag,&fooFunc);
command like this:
myprogram -myflag="a" -myflag="b"
my program relies on that each occurrence of -myflag=xxx cause a single  
invoking of fooFunc(OK,It is a workaround for other things).But actually there 
is a unnecessary invoking of fooFunc. for example, the library calls once 
fooFunc for "a",and calls twice fooFunc for "b".That just makes my program 
complex,I don't know is it a bug.I think should you change the 
behaviours of the library???

Original issue reported on code.google.com by lihawl1...@gmail.com on 12 Apr 2013 at 6:04

GoogleCodeExporter commented 9 years ago
I agree that the flag validator should only be called once per flag value.

Original comment by andreas....@gmail.com on 20 Mar 2014 at 3:25