Offering a "builder" pattern for liquibase.integration.commandline.CommandLineUtils.doDiffToChangeLog(String, Database, Database, DiffOutputControl, String)

That is a good idea. I haven’t liked the CommandLineUtils. I created Nathan

I have my own liquibase command client, mostly to allow me to define my database connection properties in my own idiosyncratic way.

Because of this I often use CommandLineUtils to execute liquibase commands.  In the 2.0 days that was pretty easy because most utils had only a few parameters and they didn’t change often.  In 3.0 and 3.1 you offer a much wider array of options and frequently introduce no ones.  This is a great developement but it causes a small problem whenever I upgrade.

If you used a “builder pattern” in lieu or in additon to a fixed set of parameters it would make it much easier to stay current.

For example

public static void doDiffToChangeLog(String changeLogFile,

                                         Database referenceDatabase,

                                         Database targetDatabase,

                                         DiffOutputControl diffOutputControl,

                                         String snapshotTypes)

would become

new DiffToChangeLogCommand()

  .setChangeLogFile(new File(“xxx”)).setReferenceDb(db1).setTargetDatabase(db2)


and DiffOutputControl and snapshotTypes would become whatever the default is unless I explicitly set them.