Fix help formatting for string and filename options

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 6511d20c9d)
This commit is contained in:
Tom Tromey
2025-01-13 07:26:10 -07:00
parent 5746383e8c
commit 52b81397b1
2 changed files with 8 additions and 2 deletions

View 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;

View 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"