On Sep 19, 2013, at 07:03 AM, Tom Browder <tom.brow...@gmail.com> wrote:

Is this okay: "bu_arg_unlabeled_value_arg"?
 
Sounds okay.  Sans trailing _arg would seem in order since it's redundant with the group label.

Question, though, why is it important that the bu_arg_value_t
first enum be an integral type?

That was from trying to initialize the union part. From this link:

It's only important for static initialization (as you can only statically initialize as first union member's type).  So you want the first to be your biggest type and the one  you want to expose (usually a function pointer if there are any as they will be the biggest).

Given that the struct has to be fixed, the integral type seemed to be
the most likely to be used.

If it is the most likely the one we'd want to static-initialize, it makes sense.. but we'll have to be careful if there are bigger types in there that might end up with garbage data.
 
So I read that if the default value is NOT given then the arg needs a
value, otherwise its value on the
command line is optional.
 
Interesting.  Okay.  That is more powerful than getopt() but will be useful for several of our tools that manually parse.  Most should probably error, not be some optional implicit value.

As far as the memory issue goes we could have a new bu_arg_exit
function/macro that would clear memory before exiting.

No different than just letting the caller free the memory.  Saves a line if the next action is to exit, but I don't think that will be the most common action.  Library routines certainly shouldn't be aborting the application because some argv failed to parse.  That's the app's job to decide.

Yes, I would certainly like to go C++ for all!
 
I know... I know... :)

You should help with the geometry engine API or network geometry service.  It's all C++ on top of the core C libraries.  Daniel's made some fantastic progress with the core interface (which I consider a central piece of the geometry engine API).

Cheers!
Sean

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to