Option --cache-maintenance is not GNU compliant
authorColin Clark <colin.clark@cclark.uk>
Sun, 14 Apr 2024 10:58:15 +0000 (11:58 +0100)
committerColin Clark <colin.clark@cclark.uk>
Sun, 14 Apr 2024 10:58:15 +0000 (11:58 +0100)
https://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html

The option requires an equals sign as a separator.

doc/docbook/CommandLineOptions.xml
geeqie.1
src/cache-maint.cc
src/main.cc

index 527779d..ecf8890 100644 (file)
@@ -8,7 +8,7 @@
 <refentrytitle>GEEQIE</refentrytitle>
 <manvolnum>1</manvolnum>
 <refmiscinfo class='source'>April 2024</refmiscinfo>
-<refmiscinfo class='manual'>Geeqie 2.4+git20240413-2a5c2a89 GTK3</refmiscinfo>
+<refmiscinfo class='manual'>Geeqie 2.4+git20240413-fc816858 GTK3</refmiscinfo>
 </refmeta>
 <refnamediv>
 <refname>Geeqie</refname>
@@ -30,7 +30,7 @@ zooming, panning, thumbnails and sorting images into collections.</para>
 
 <para>Generated for version:</para>
 
-<para>Geeqie 2.4+git20240413-2a5c2a89</para>
+<para>Geeqie 2.4+git20240413-fc816858</para>
 
 <refsect2 id='valid_options'><title>Valid options:</title>
 <variablelist remap='TP'>
@@ -41,7 +41,7 @@ zooming, panning, thumbnails and sorting images into collections.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><emphasis role='strong' remap='B'>--cache-maintenance</emphasis> &lt;path&gt;</term>
+  <term><emphasis role='strong' remap='B'>--cache-maintenance=</emphasis>&lt;path&gt;</term>
   <listitem>
 <para>run cache maintenance in non-GUI mode</para>
   </listitem>
index def25f6..45d716b 100644 (file)
--- a/geeqie.1
+++ b/geeqie.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.49.3.
-.TH GEEQIE "1" "April 2024" "Geeqie 2.4+git20240413-2a5c2a89 GTK3" "User Commands"
+.TH GEEQIE "1" "April 2024" "Geeqie 2.4+git20240413-fc816858 GTK3" "User Commands"
 .SH NAME
 Geeqie - GTK based multiformat image viewer
 .SH SYNOPSIS
@@ -11,13 +11,13 @@ zooming, panning, thumbnails and sorting images into collections.
 
 Generated for version:
 .PP
-Geeqie 2.4+git20240413\-2a5c2a89
+Geeqie 2.4+git20240413\-fc816858
 .SS "Valid options:"
 .TP
 \fB\-\-blank\fR
 start with blank file list
 .TP
-\fB\-\-cache\-maintenance\fR <path>
+\fB\-\-cache\-maintenance=\fR<path>
 run cache maintenance in non\-GUI mode
 .TP
 \fB\-\-disable\-clutter\fR
index b6f68c5..3d28d73 100644 (file)
@@ -1639,7 +1639,7 @@ static void cache_manager_cache_maintenance_start_cb(GenericDialog *, gpointer d
                }
        else
                {
-               cmd_line = g_strdup_printf("%s --cache-maintenance \"%s\"", gq_executable_path, path);
+               cmd_line = g_strdup_printf("%s --cache-maintenance=\"%s\"", gq_executable_path, path);
 
                g_spawn_command_line_async(cmd_line, nullptr);
 
index 7e4b86a..d933630 100644 (file)
@@ -484,7 +484,7 @@ static void parse_command_line(gint argc, gchar *argv[])
                                printf_term(FALSE, _("Usage: %s [options] [path]\n\n"), GQ_APPNAME_LC);
                                print_term(FALSE, _("Valid options:\n"));
                                print_term(FALSE, _("      --blank                      start with blank file list\n"));
-                               print_term(FALSE, _("      --cache-maintenance <path>   run cache maintenance in non-GUI mode\n"));
+                               print_term(FALSE, _("      --cache-maintenance=<path>   run cache maintenance in non-GUI mode\n"));
                                print_term(FALSE, _("      --disable-clutter            disable use of Clutter library (i.e. GPU accel.)\n"));
                                print_term(FALSE, _("  -f, --fullscreen                 start in full screen mode\n"));
                                print_term(FALSE, _("      --geometry=WxH+XOFF+YOFF     set main window location\n"));
@@ -696,7 +696,7 @@ static gboolean parse_command_line_for_clutter_option(gint argc, gchar *argv[])
 
 static gboolean parse_command_line_for_cache_maintenance_option(gint argc, gchar *argv[])
 {
-       const gchar *cache_maintenance_option = "--cache-maintenance";
+       const gchar *cache_maintenance_option = "--cache-maintenance=";
        gint len = strlen(cache_maintenance_option);
        gboolean ret = FALSE;
 
@@ -721,9 +721,12 @@ static void process_command_line_for_cache_maintenance_option(gint argc, gchar *
        gchar *buf_config_file;
        gint diff_count;
 
-       if (argc >= 3)
+       const gchar *cache_maintenance_option = "--cache-maintenance=";
+       gint len = strlen(cache_maintenance_option);
+
+       if (argc >= 2)
                {
-               folder_path = expand_tilde(argv[2]);
+               folder_path = expand_tilde(argv[1] + len);
 
                if (isdir(folder_path))
                        {
@@ -771,7 +774,7 @@ static void process_command_line_for_cache_maintenance_option(gint argc, gchar *
                        }
                else
                        {
-                       print_term(TRUE, g_strconcat(argv[2], _(" is not a folder\n"), NULL));
+                       print_term(TRUE, g_strconcat(argv[1] + len, _(" is not a folder\n"), NULL));
                        exit(EXIT_FAILURE);
                        }
                g_free(folder_path);