On Sun, 2009-12-06 at 16:28 +0100, Emanuele Aina wrote:
> diff --git a/src/DbMetal/Generator/Implementation/Processor.cs
> b/src/DbMetal/Generator/Implementation/Processor.cs
> index 5a93e50..2c1ad96 100644
> --- a/src/DbMetal/Generator/Implementation/Processor.cs
> +++ b/src/DbMetal/Generator/Implementation/Processor.cs
> @@ -98,7 +98,7 @@ namespace DbMetal.Generator.Implementation
>
> ProcessSchema(parameters);
>
> - if (parameters.ReadLineAtExit)
> + if (parameters.Readline)
This makes me ponder the wisdom of renaming these members, as the patch
has effectively two mostly unrelated changes: DbMetal option cleanup,
and renaming Parameters members. Does renaming ReadLineAtExit actually
buy anything? (Ditto for GenerateEqualsHash.)
Just pondering out loud here; don't change them, but it does increase
the patch size for no significant reason...
> diff --git a/src/DbMetal/Parameters.cs b/src/DbMetal/Parameters.cs
> index 9d6eb21..7aae58b 100644
> --- a/src/DbMetal/Parameters.cs
> +++ b/src/DbMetal/Parameters.cs
> @@ -227,111 +205,109 @@ namespace DbMetal
...
> { "schema",
> - "Generate schema in code files (default='true').",
> - v => Schema = v != null},
> + "Generate schema in code files (default: enabled).",
> + (bool v) => Schema = v },
Don't do this (see also the commit message for r1280).
At least until Mono.Options is fixed to treat boolean options in a more
consistent manner, you should always compare the value against null and
not use (bool v) (unless you actually want the user to write
'-schema=True' instead of '-schema').
> - { "generateEqualsAndHash",
> + { "generate-equals-hash",
> "Generates overrides for Equals() and GetHashCode()
> methods.",
> - v => GenerateEqualsAndHash = v != null},
> + (bool v) => GenerateEqualsHash = v },
Same issue: don't do this.
> { "generate-timestamps",
> - "Generate timestampes in the generated code. True by
> default.",
> - v => GenerateTimestamps = v != null },
> - { "readlineAtExit",
> + "Generate timestampes in the generated code (default:
> enabled).",
> + (bool v) => GenerateTimestamps = v },
> + { "readline",
> "Wait for a key to be pressed after processing.",
> - v => ReadLineAtExit = v != null },
> + (bool v) => Readline = v },
Same here.
Also, I would strongly suggest that you run the DbMetal unit tests, as
if you had done so you would have seen that the DbMetal_test_sqlite
tests would have failed (or should have, anyway) as they use some
DbMetal boolean command-line options which would fail when using (bool
v) parameters; see src/DbMetal/Test/CreateEntitiesFromSqliteDbTest.cs:
s.Run(new string[]{
"/code:Northwind.Sqlite.cs",
"/conn:Data Source=" + Path.Combine(testdir, "Northwind.db3"),
"/database:Northwind",
"--generate-timestamps-",
"/namespace:nwind",
"/pluralize",
"/provider:Sqlite",
});
I realize that not everyone will run the SQL Server tests, but I don't
see much reason not to run the SQLite tests... (Though, come to think
of it, I think those rely on System.Data.SQLite.dll, not
Mono.Data.Sqlite, meaning they won't run under Mono. I should fix
that...)
- 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.