[gnumeric] ssconvert: add --verbose



commit 215fd5cf891b38dbd2a847f81c0ad45806434af0
Author: Morten Welinder <terra gnome org>
Date:   Wed Mar 12 14:53:25 2014 -0400

    ssconvert: add --verbose

 ChangeLog       |    5 +++++
 src/ssconvert.c |   15 ++++++++++++---
 2 files changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7e7fc69..9ed8514 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-03-12  Morten Welinder  <terra gnome org>
+
+       * src/ssconvert.c (convert): only print "Using exporter ..." if
+       --verbose is given, and print it to stderr.
+
 2014-03-11  Morten Welinder  <terra gnome org>
 
        * src/sheet.c (cb_set_markup): Don't mess directly with
diff --git a/src/ssconvert.c b/src/ssconvert.c
index 75f4006..f8a44dd 100644
--- a/src/ssconvert.c
+++ b/src/ssconvert.c
@@ -41,6 +41,7 @@
 #endif
 
 static gboolean ssconvert_show_version = FALSE;
+static gboolean ssconvert_verbose = FALSE;
 static gboolean ssconvert_list_exporters = FALSE;
 static gboolean ssconvert_list_importers = FALSE;
 static gboolean ssconvert_one_file_per_sheet = FALSE;
@@ -58,12 +59,19 @@ static char **ssconvert_tool_test = NULL;
 
 static const GOptionEntry ssconvert_options [] = {
        {
-               "version", 'v',
+               "version", 0,
                0, G_OPTION_ARG_NONE, &ssconvert_show_version,
                N_("Display program version"),
                NULL
        },
 
+       {
+               "verbose", 'v',
+               0, G_OPTION_ARG_NONE, &ssconvert_verbose,
+               N_("Be somewhat more verbose during conversion"),
+               NULL
+       },
+
        /* ---------------------------------------- */
 
        {
@@ -675,8 +683,9 @@ convert (char const *inarg, char const *outarg, char const *mergeargs[],
                                            outfile);
                                goto out;
                        }
-                       g_print ("Using exporter %s\n",
-                                go_file_saver_get_id (fs));
+                       if (ssconvert_verbose)
+                               g_printerr ("Using exporter %s\n",
+                                           go_file_saver_get_id (fs));
                }
        }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]