]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix help formatting for string and filename options
authorTom Tromey <tromey@adacore.com>
Mon, 13 Jan 2025 14:26:10 +0000 (07:26 -0700)
committerTom Tromey <tromey@adacore.com>
Wed, 15 Jan 2025 15:25:06 +0000 (08:25 -0700)
I happened to notice that "help add-inferior" said:

  -execFILENAME
    FILENAME is the file name of the executable to use as the
    main program.

This is missing a space after "-exec".  This patch fixes the bug.

If ok'd on time I plan to check this in to the gdb-16 branch as well.

Approved-by: Kevin Buettner <kevinb@redhat.com>
(cherry picked from commit 6511d20c9d47093acb3b099ff19854e01bbe9af4)

gdb/cli/cli-option.c
gdb/testsuite/gdb.base/options.exp

index fa00b913c99d81608220ab853244989fec511078..712bcd74cb9b80dc9d6db15e51e4b1afda1e8da5 100644 (file)
@@ -790,10 +790,10 @@ append_val_type_str (std::string &help, const option_def &opt,
       }
       break;
     case var_string:
-      help += "STRING";
+      help += " STRING";
       break;
     case var_filename:
-      help += "FILENAME";
+      help += " FILENAME";
       break;
     default:
       break;
index e1ad61e647028b81763311e8ac97dd79ae5e45be..a1ca39eab11794445d52a8668216f35cb591fac9 100644 (file)
@@ -1162,3 +1162,9 @@ test-thread-apply
 
 # Basic "info threads" integration tests.
 test-info-threads
+
+# There was a bug where the "metasyntactic variable" was glued to the
+# option.
+gdb_test "help maintenance test-options unknown-is-operand" \
+    "-string STRING.*-filename FILENAME.*" \
+    "option help has spaces"