On Wed, 2009-11-04 at 22:19 +0100, Emanuele Aina wrote:
> I've replaced the custom (broken) command line option parsing system
> with Mono.Options.

Ooh, one other comment that just occurred to me: you shouldn't use
Parameters.GetArray() for e.g. Parameters.EntityImplementedInterfaces,
as it would be useful for the user to be able to specify the option
multiple times, e.g.

        DbMetal --entityInterfaces=IFoo --entityInterfaces=IBar

If they attempt to do so, the 2nd --entityInterfaces will "overwrite"
the first one.

What should instead be done is this:

        class Parameters {
                // remove public string EntityInterfaces,
                // EntityImplementedInterfaces, and instead:
                public List<string> EntityImplementedInterfaces = new 
List<string>();
        }

And in the OptionSet:

        new OptionSet() {
                // ..
                { "entityInterfaces=", "..."
                  v => EntityImplementedInterfaces.AddRange(
                        v.Split(new[]{','}, 
StringSplitOptions.RemoveEmptyEntries)) }
                // ...
        };

This would allow --entityInterfaces to be invoked multiple times and
work in an *additive* fashion during each invocation.

 - Jon



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DbLinq" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/dblinq?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to