Re: [PATCH v3 2/2] MI: Add new command -complete

Eli Zaretskii
2019-03-04T17:35:44Z

> From: Jan Vrany <jan.vrany@fit.cvut.cz>
> Cc: Jan Vrany <jan.vrany@fit.cvut.cz>
> Date: Mon, 4 Mar 2019 14:52:03 +0000
>
> There is a CLI command 'complete' intended to use with emacs. Such a command
> would also be useful for MI frontends, when separate CLI and MI channels cannot
> be used. For example, on Windows (because of lack of PTYs) or when GDB is used
> through SSH session.
>
> This commit adds a new '-complete' MI command.

Thanks.

> diff --git a/gdb/NEWS b/gdb/NEWS
> index eaef6aa384..3018313a46 100644
> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -96,6 +96,13 @@ maint show dwarf unwinders
> info proc files
> Display a list of open files for a process.
>
> +* New MI commands
> +
> +-complete
> + This lists all the possible completions for the rest of the line, if it
> + were to be given as a command itself. This is intended for use by MI frontends
> + in cases when separate CLI and MI channels cannot be used.

This part is OK.

> +CLI and MI channels - for example: because of lack of PTYs like on Windows or
> +because @sc{gdb} is used remotely via a SSH connection.

We use "@value{GDBN}" instead of a literal "gdb" in the manual.

> +@item completion
> +This field contain a string to be completed on a command line, including
^^^^^^^
"contains"

> +@var{command} passed as parameter to @code{-complete} command. If nothing can
^^
Two spaces between sentences, please.

> +be completed this field is omitted.
^
Comma missing here.

I find this text a bit confusing, so I suggest a slight rewording:

This field contains the completed @var{command}. If @var{command}
has no known completions, this field is omitted.

> +@item matches
> +This field contain (possibly empty) array of matches. It is always present.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"contains a (possibly empty) list of matches"

> +@end table

What about the max_completions_reached field? I see it here:

> +^done,completion="break",matches=["break","break-range"],max_completions_reached="0"