]> 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:20:03 +0000 (08:20 -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>
gdb/cli/cli-option.c
gdb/testsuite/gdb.base/options.exp

index 10a59449f7cbf9809fda6ffcbc74286dec5e743c..34ac1642b8447ec13b09248d2607b995e062f6ec 100644 (file)
@@ -832,10 +832,10 @@ append_val_type_str (std::string &help, const option_def &opt,
       help += "NUMBER|#RRGGBB";
       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"