[PATCH 3/3] ui/console: Note in '-display help' that some backends support suboptions

Peter Maydell posted 3 patches 3 months, 3 weeks ago
[PATCH 3/3] ui/console: Note in '-display help' that some backends support suboptions
Posted by Peter Maydell 3 months, 3 weeks ago
Currently '-display help' only prints the available backends. Some
of those backends support suboptions (e.g. '-display gtk,gl=on').
Mention that in the help output, and point the user to where they
might be able to find more information about the suboptions.
The new output looks like this:

$ qemu-system-aarch64 -display help
Available display backend types:
none
gtk
sdl
egl-headless
curses
spice-app
dbus

Some display backends support suboptions, which can be set with
   -display backend,option=value,option=value...
For a short list of the suboptions for each display, see the top-level -help output; more detail is in the documentation.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
The ideal here would be to programmatically list all the
suboptions, so you could say '-display gtk,help', but that
seems like a lot of work and I'm not entirely sure how
to do it :-)
---
 ui/console.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ui/console.c b/ui/console.c
index e8f0083af71..105a0e2c708 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1632,4 +1632,9 @@ void qemu_display_help(void)
             printf("%s\n",  DisplayType_str(dpys[idx]->type));
         }
     }
+    printf("\n"
+           "Some display backends support suboptions, which can be set with\n"
+           "   -display backend,option=value,option=value...\n"
+           "For a short list of the suboptions for each display, see the "
+           "top-level -help output; more detail is in the documentation.\n");
 }
-- 
2.34.1
Re: [PATCH 3/3] ui/console: Note in '-display help' that some backends support suboptions
Posted by Philippe Mathieu-Daudé 3 months, 2 weeks ago
On 31/7/24 17:41, Peter Maydell wrote:
> Currently '-display help' only prints the available backends. Some
> of those backends support suboptions (e.g. '-display gtk,gl=on').
> Mention that in the help output, and point the user to where they
> might be able to find more information about the suboptions.
> The new output looks like this:
> 
> $ qemu-system-aarch64 -display help
> Available display backend types:
> none
> gtk
> sdl
> egl-headless
> curses
> spice-app
> dbus
> 
> Some display backends support suboptions, which can be set with
>     -display backend,option=value,option=value...
> For a short list of the suboptions for each display, see the top-level -help output; more detail is in the documentation.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> The ideal here would be to programmatically list all the
> suboptions, so you could say '-display gtk,help', but that
> seems like a lot of work and I'm not entirely sure how
> to do it :-)
> ---
>   ui/console.c | 5 +++++
>   1 file changed, 5 insertions(+)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>