qemu-options: Rework the help text of the '-display' option
diff mbox series

Message ID 20191023120129.13721-1-huth@tuxfamily.org
State New
Headers show
Series
  • qemu-options: Rework the help text of the '-display' option
Related show

Commit Message

Thomas Huth Oct. 23, 2019, 12:01 p.m. UTC
Improve the help text of the "-display" option:

- Only print the options that we have enabled in the binary
  (similar to what we do for other options like -netdev already)

- The "frame=on|off" from "-display sdl" has been removed in commit
  09bd7ba9f5f7 ("Remove deprecated -no-frame option"), so we should
  not show this in the help text anymore

- The "-display egl-headless" line was missing a "\n" at the end

- Indent the default display text in a nicer way

Signed-off-by: Thomas Huth <huth@tuxfamily.org>
---
 qemu-options.hx | 30 +++++++++++++++++++++---------
 1 file changed, 21 insertions(+), 9 deletions(-)

Comments

Philippe Mathieu-Daudé Oct. 23, 2019, 12:26 p.m. UTC | #1
On 10/23/19 2:01 PM, Thomas Huth wrote:
> Improve the help text of the "-display" option:
> 
> - Only print the options that we have enabled in the binary
>    (similar to what we do for other options like -netdev already)
> 
> - The "frame=on|off" from "-display sdl" has been removed in commit
>    09bd7ba9f5f7 ("Remove deprecated -no-frame option"), so we should
>    not show this in the help text anymore
> 
> - The "-display egl-headless" line was missing a "\n" at the end
> 
> - Indent the default display text in a nicer way
> 
> Signed-off-by: Thomas Huth <huth@tuxfamily.org>
> ---
>   qemu-options.hx | 30 +++++++++++++++++++++---------
>   1 file changed, 21 insertions(+), 9 deletions(-)
> 
> diff --git a/qemu-options.hx b/qemu-options.hx
> index 996b6fba74..917c54b302 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -1526,26 +1526,38 @@ STEXI
>   ETEXI
>   
>   DEF("display", HAS_ARG, QEMU_OPTION_display,
> +#if defined(CONFIG_SPICE)
>       "-display spice-app[,gl=on|off]\n"
> -    "-display sdl[,frame=on|off][,alt_grab=on|off][,ctrl_grab=on|off]\n"
> +#endif
> +#if defined(CONFIG_SDL)
> +    "-display sdl[,alt_grab=on|off][,ctrl_grab=on|off]\n"
>       "            [,window_close=on|off][,gl=on|core|es|off]\n"
> +#endif
> +#if defined(CONFIG_GTK)
>       "-display gtk[,grab_on_hover=on|off][,gl=on|off]|\n"
> +#endif
> +#if defined(CONFIG_VNC)
>       "-display vnc=<display>[,<optargs>]\n"
> +#endif
> +#if defined(CONFIG_CURSES)
>       "-display curses[,charset=<encoding>]\n"
> +#endif
> +#if defined(CONFIG_OPENGL)
> +    "-display egl-headless[,rendernode=<file>]\n"
> +#endif
>       "-display none\n"
> -    "-display egl-headless[,rendernode=<file>]"
> -    "                select display type\n"
> -    "The default display is equivalent to\n"
> +    "                select display backend type\n"
> +    "                The default display is equivalent to\n                "

Easier to understand in 2 lines:

        "                The default display is equivalent to\n"
        "                "

Regardless,
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

>   #if defined(CONFIG_GTK)
> -            "\t\"-display gtk\"\n"
> +            "\"-display gtk\"\n"
>   #elif defined(CONFIG_SDL)
> -            "\t\"-display sdl\"\n"
> +            "\"-display sdl\"\n"
>   #elif defined(CONFIG_COCOA)
> -            "\t\"-display cocoa\"\n"
> +            "\"-display cocoa\"\n"
>   #elif defined(CONFIG_VNC)
> -            "\t\"-vnc localhost:0,to=99,id=default\"\n"
> +            "\"-vnc localhost:0,to=99,id=default\"\n"
>   #else
> -            "\t\"-display none\"\n"
> +            "\"-display none\"\n"
>   #endif
>       , QEMU_ARCH_ALL)
>   STEXI
>
Gerd Hoffmann Oct. 24, 2019, 8:23 a.m. UTC | #2
On Wed, Oct 23, 2019 at 02:01:28PM +0200, Thomas Huth wrote:
> Improve the help text of the "-display" option:
> 
> - Only print the options that we have enabled in the binary
>   (similar to what we do for other options like -netdev already)
> 
> - The "frame=on|off" from "-display sdl" has been removed in commit
>   09bd7ba9f5f7 ("Remove deprecated -no-frame option"), so we should
>   not show this in the help text anymore
> 
> - The "-display egl-headless" line was missing a "\n" at the end
> 
> - Indent the default display text in a nicer way
> 
> Signed-off-by: Thomas Huth <huth@tuxfamily.org>

Queue up for UI.

thanks,
  Gerd

Patch
diff mbox series

diff --git a/qemu-options.hx b/qemu-options.hx
index 996b6fba74..917c54b302 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1526,26 +1526,38 @@  STEXI
 ETEXI
 
 DEF("display", HAS_ARG, QEMU_OPTION_display,
+#if defined(CONFIG_SPICE)
     "-display spice-app[,gl=on|off]\n"
-    "-display sdl[,frame=on|off][,alt_grab=on|off][,ctrl_grab=on|off]\n"
+#endif
+#if defined(CONFIG_SDL)
+    "-display sdl[,alt_grab=on|off][,ctrl_grab=on|off]\n"
     "            [,window_close=on|off][,gl=on|core|es|off]\n"
+#endif
+#if defined(CONFIG_GTK)
     "-display gtk[,grab_on_hover=on|off][,gl=on|off]|\n"
+#endif
+#if defined(CONFIG_VNC)
     "-display vnc=<display>[,<optargs>]\n"
+#endif
+#if defined(CONFIG_CURSES)
     "-display curses[,charset=<encoding>]\n"
+#endif
+#if defined(CONFIG_OPENGL)
+    "-display egl-headless[,rendernode=<file>]\n"
+#endif
     "-display none\n"
-    "-display egl-headless[,rendernode=<file>]"
-    "                select display type\n"
-    "The default display is equivalent to\n"
+    "                select display backend type\n"
+    "                The default display is equivalent to\n                "
 #if defined(CONFIG_GTK)
-            "\t\"-display gtk\"\n"
+            "\"-display gtk\"\n"
 #elif defined(CONFIG_SDL)
-            "\t\"-display sdl\"\n"
+            "\"-display sdl\"\n"
 #elif defined(CONFIG_COCOA)
-            "\t\"-display cocoa\"\n"
+            "\"-display cocoa\"\n"
 #elif defined(CONFIG_VNC)
-            "\t\"-vnc localhost:0,to=99,id=default\"\n"
+            "\"-vnc localhost:0,to=99,id=default\"\n"
 #else
-            "\t\"-display none\"\n"
+            "\"-display none\"\n"
 #endif
     , QEMU_ARCH_ALL)
 STEXI