--- /dev/null
+/*
+ * Copyright (C) 2018 Andrea Zagli <azagli@libero.it>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "libzakdbt.h"
+
+static gchar *cnc_string;
+static gchar *xml_filename;
+
+static GOptionEntry entries[] =
+{
+ { "cnc_string", 'c', 0, G_OPTION_ARG_STRING, &cnc_string, "Connection string to database", NULL },
+ { "xml_filename", 'x', 0, G_OPTION_ARG_FILENAME, &xml_filename, "ZakDbt xml file name", NULL },
+ { NULL }
+};
+
+int
+main (int argc, char **argv)
+{
+ GOptionContext *ctx;
+
+ GError *error;
+
+ ZakDbtDbt *dbt;
+
+ cnc_string = NULL;
+ xml_filename = NULL;
+
+ ctx = g_option_context_new ("");
+ g_option_context_add_main_entries (ctx, entries, "zdbt");
+ if (!g_option_context_parse (ctx, &argc, &argv, &error))
+ {
+ g_warning ("Error on command line arguments: %s.",
+ error != NULL && error->message != NULL ? error->message : "no details");
+ }
+
+ if (cnc_string == NULL)
+ {
+ g_message ("You must provide the connection string to database.");
+ return 0;
+ }
+
+ if (xml_filename == NULL)
+ {
+ g_message ("You must provide the ZakDbt xml file name.");
+ return 0;
+ }
+
+ dbt = zak_dbt_dbt_new ();
+
+ zak_dbt_dbt_set_db_connection_from_string (dbt, cnc_string);
+ zak_dbt_dbt_set_xml_from_filename (dbt, xml_filename);
+
+ if (zak_dbt_dbt_db_is_updated (dbt))
+ {
+ g_message ("Database is updated.");
+ return 0;
+ }
+ else
+ {
+ g_message ("Database is not updated.");
+ }
+
+ zak_dbt_dbt_transform (dbt);
+
+ return 0;
+}