[gnumeric] sstest: move dumping of samples to here from main binary.



commit c385bb314c1b663fd6d533955d127daf1b25e343
Author: Morten Welinder <terra gnome org>
Date:   Wed Nov 29 18:31:23 2017 -0500

    sstest: move dumping of samples to here from main binary.
    
    This avoids one of many hidden options for Gnumeric that are not useful
    for non-developers.

 src/main-application.c |    9 ---------
 src/sstest.c           |   11 +++++++++++
 test/t6590-samples.pl  |    2 +-
 3 files changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/src/main-application.c b/src/main-application.c
index 36167b7..561561c 100644
--- a/src/main-application.c
+++ b/src/main-application.c
@@ -53,7 +53,6 @@ static gboolean gnumeric_no_warnings = FALSE;
 static gchar  *func_def_file = NULL;
 static gchar  *func_state_file = NULL;
 static gchar  *ext_refs_file = NULL;
-static gchar  *samples_file = NULL;
 static gchar  *geometry = NULL;
 static gchar **startup_files;
 
@@ -92,12 +91,6 @@ static const GOptionEntry gnumeric_options [] = {
                N_("FILE")
        },
        {
-               "samples-file", 0,
-               G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_FILENAME, &samples_file,
-               N_("Dumps list of samples in function help"),
-               N_("FILE")
-       },
-       {
                "split-func", 0,
                G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &split_funcdocs,
                N_("Generate new help and po files"),
@@ -294,8 +287,6 @@ main (int argc, char const **argv)
                return gnm_dump_func_defs (NULL, 2);
        if (ext_refs_file)
                return gnm_dump_func_defs (ext_refs_file, 4);
-       if (samples_file)
-               return gnm_dump_func_defs (samples_file, 5);
 
        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 b6d052b..6ab2e26 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 *samples_file = NULL;
 
 static GOptionEntry const sstest_options [] = {
        {
@@ -46,6 +47,13 @@ static GOptionEntry const sstest_options [] = {
        },
 
        {
+               "samples-file", 0,
+               0, G_OPTION_ARG_FILENAME, &samples_file,
+               N_("Dumps list of samples in function help"),
+               N_("FILE")
+       },
+
+       {
                "version", 'V',
                0, G_OPTION_ARG_NONE, &sstest_show_version,
                N_("Display program version"),
@@ -2657,6 +2665,9 @@ main (int argc, char const **argv)
                go_error_info_free (plugin_errs);
        }
 
+       if (samples_file)
+               return gnm_dump_func_defs (samples_file, 5);
+
        testname = argv[1];
        if (!testname) testname = "all";
 
diff --git a/test/t6590-samples.pl b/test/t6590-samples.pl
index ba222f5..92c66df 100755
--- a/test/t6590-samples.pl
+++ b/test/t6590-samples.pl
@@ -9,7 +9,7 @@ $GnumericTest::default_subtests = '*,-biff7';
 my $csvfile = "samples.csv";
 &GnumericTest::junkfile ($csvfile);
 {
-    my $cmd = "$gnumeric --samples-file=$csvfile";
+    my $cmd = "$sstest --samples-file=$csvfile";
     print STDERR "# $cmd\n" if $GnumericTest::verbose;
     system ($cmd);
     if (!-r $csvfile) {


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