[gnumeric] sstest: move --dump-func-defs to here from main binary



commit 081c6136339f00acad9d8c089b3a16771eb00490
Author: Morten Welinder <terra gnome org>
Date:   Wed Nov 29 18:44:28 2017 -0500

    sstest: move --dump-func-defs to here from main binary
    
    Again not really test related, but it is a better match than the gui
    binary.

 doc/Makefile.am        |    2 +-
 src/main-application.c |   11 +----------
 src/sstest.c           |   10 ++++++++++
 3 files changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 4705b58..74f18dd 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -551,7 +551,7 @@ C/functions.xml: $(srcdir)/make-func-list.pl $(functions_xml_parts)
        fi
 
 C/func.defs: # $(top_builddir)/src/gnumeric$(EXEEXT)
-       LC_ALL="C" ; export LC_ALL ; $(top_builddir)/src/gnumeric --dump-func-defs="$@"
+       LC_ALL="C" ; export LC_ALL ; $(top_builddir)/src/sstest --dump-func-defs="$@"
 
 EXTRA_DIST+=C/func.defs
 DISTCLEANFILES+=C/func.defs
diff --git a/src/main-application.c b/src/main-application.c
index dbc403f..e17bd79 100644
--- a/src/main-application.c
+++ b/src/main-application.c
@@ -49,7 +49,6 @@
 static gboolean immediate_exit_flag = FALSE;
 static gboolean gnumeric_no_splash = FALSE;
 static gboolean gnumeric_no_warnings = FALSE;
-static gchar  *func_def_file = NULL;
 static gchar  *func_state_file = NULL;
 static gchar  *geometry = NULL;
 static gchar **startup_files;
@@ -71,12 +70,6 @@ static const GOptionEntry gnumeric_options [] = {
        /*********************************
         * Hidden Actions */
        {
-               "dump-func-defs", 0,
-               G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_FILENAME, &func_def_file,
-               N_("Dumps the function definitions"),
-               N_("FILE")
-       },
-       {
                "dump-func-state", 0,
                G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_FILENAME, &func_state_file,
                N_("Dumps the function definitions"),
@@ -256,7 +249,7 @@ main (int argc, char const **argv)
        bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
        bind_textdomain_codeset (GETTEXT_PACKAGE "-functions", "UTF-8");
 
-       with_gui = !func_def_file && !func_state_file;
+       with_gui = !func_state_file;
 
        if (with_gui) {
                gnm_session_init (argv[0]);
@@ -267,8 +260,6 @@ main (int argc, char const **argv)
        /* These are useful for the build process only.  */
        if (func_state_file)
                return gnm_dump_func_defs (func_state_file, 0);
-       if (func_def_file)
-               return gnm_dump_func_defs (func_def_file, 1);
 
        if (with_gui) {
                go_component_set_default_command_context (cc = gnm_cmd_context_stderr_new ());
diff --git a/src/sstest.c b/src/sstest.c
index 346fa8f..168bf47 100644
--- a/src/sstest.c
+++ b/src/sstest.c
@@ -36,6 +36,7 @@
 
 static gboolean sstest_show_version = FALSE;
 static gboolean sstest_fast = FALSE;
+static gchar *func_def_file = NULL;
 static gchar *ext_refs_file = NULL;
 static gchar *samples_file = NULL;
 
@@ -48,6 +49,13 @@ static GOptionEntry const sstest_options [] = {
        },
 
        {
+               "dump-func-defs", 0,
+               0, G_OPTION_ARG_FILENAME, &func_def_file,
+               N_("Dumps the function definitions"),
+               N_("FILE")
+       },
+
+       {
                "ext-refs-file", 0,
                0, G_OPTION_ARG_FILENAME, &ext_refs_file,
                N_("Dumps web page for function help"),
@@ -2673,6 +2681,8 @@ main (int argc, char const **argv)
                go_error_info_free (plugin_errs);
        }
 
+       if (func_def_file)
+               return gnm_dump_func_defs (func_def_file, 1);
        if (ext_refs_file)
                return gnm_dump_func_defs (ext_refs_file, 4);
        if (samples_file)


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