Skip to contentSkip to conversation

Reorganize help output of '-display' option

PATCH Superseded Robert Ho 2 participants 2 messages Jul 17, 2016 – Jul 25, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Robert Ho

author
#0 lore raw

PATCH 1/1 Reorganize help output of '-display' option

The '-display' help information is not very correct. This patch sort it a little.
Also, in its help information, reveals what implicit display option will be chosen if no definition.

P.S.
Hi Markus,

Sorry for late of sending out this patch. Really busy recently, and it also took me some time to understand the framework help message generation.

---
 qemu-options.hx | 32 +++++++++++++++++++++++++-------
 1 file changed, 25 insertions(+), 7 deletions(-)
qemu-options.hx +25 -7
index 17f15ad..69cf668 100644
@@ -930,10 +930,26 @@ ETEXI
 
 DEF("display", HAS_ARG, QEMU_OPTION_display,
     "-display sdl[,frame=on|off][,alt_grab=on|off][,ctrl_grab=on|off]\n"
-    "            [,window_close=on|off]|curses|none|\n"
-    "            gtk[,grab_on_hover=on|off]|\n"
-    "            vnc=<display>[,<optargs>]\n"
-    "                select display type\n", QEMU_ARCH_ALL)
+    "            [,window_close=on|off][,gl=on|off]|curses|none|\n"
+    "-display gtk[,grab_on_hover=on|off][,gl=on|off]|\n"
+    "-display vnc=<display>[,<optargs>]\n"
+    "-display curses\n"
+    "-display none"
+    "                select display type\n"
+    "If no -display option or its sugars (sd, curses, vnc, etc) defined,"
+    " qemu will implicitly use\n"
+#if defined(CONFIG_GTK)
+            "\t\"-dispaly gtk\"\n"
+#elif defined(CONFIG_SDL)
+            "\t\"-display sdl\"\n"
+#elif defined(CONFIG_COCOA)
+            "\t\"-display cocoa\"\n"
+#elif defined(CONFIG_VNC)
+            "\t\"-vnc localhost:0,to=99,id=default\"\n"
+#else
+            "\t\"-display none\"\n"
+#endif
+    , QEMU_ARCH_ALL)
 STEXI
 @item -display @var{type}
 @findex -display
@@ -980,7 +996,8 @@ the console and monitor.
 ETEXI
 
 DEF("curses", 0, QEMU_OPTION_curses,
-    "-curses         use a curses/ncurses interface instead of SDL\n",
+    "-curses         use a curses/ncurses interface instead of SDL; "
+    "is sugar for -display curses\n",
     QEMU_ARCH_ALL)
 STEXI
 @item -curses
@@ -1030,7 +1047,7 @@ Disable SDL window close capability.
 ETEXI
 
 DEF("sdl", 0, QEMU_OPTION_sdl,
-    "-sdl            enable SDL\n", QEMU_ARCH_ALL)
+    "-sdl            enable SDL; is sugar for -display sdl\n", QEMU_ARCH_ALL)
 STEXI
 @item -sdl
 @findex -sdl
@@ -1227,7 +1244,8 @@ Set the initial graphical resolution and depth (PPC, SPARC only).
 ETEXI
 
 DEF("vnc", HAS_ARG, QEMU_OPTION_vnc ,
-    "-vnc display    start a VNC server on display\n", QEMU_ARCH_ALL)
+    "-vnc display    start a VNC server on display; is sugar for"
+" -display vnc=display\n", QEMU_ARCH_ALL)
 STEXI
 @item -vnc @var{display}[,@var{option}[,@var{option}[,...]]]
 @findex -vnc
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 10 lines · Robert Ho

The '-display' help information is not very correct. This patch sort it a little.
Also, in its help information, reveals what implicit display option will be chosen if no definition.

P.S.
Hi Markus,

Sorry for late of sending out this patch. Really busy recently, and it also took me some time to understand the framework help message generation.

No problem :)

Quoted 15 lines
---
 qemu-options.hx | 32 +++++++++++++++++++++++++-------
 1 file changed, 25 insertions(+), 7 deletions(-)
qemu-options.hx +0 -2
index 17f15ad..69cf668 100644
@@ -930,10 +930,26 @@ ETEXI
 
 DEF("display", HAS_ARG, QEMU_OPTION_display,
     "-display sdl[,frame=on|off][,alt_grab=on|off][,ctrl_grab=on|off]\n"
-    "            [,window_close=on|off]|curses|none|\n"
-    "            gtk[,grab_on_hover=on|off]|\n"

qemu-options.hx ETEXI · line 940

Quoted 10 lines
qemu-options.hx +8 -2
-    "            vnc=<display>[,<optargs>]\n"
-    "                select display type\n", QEMU_ARCH_ALL)
+    "            [,window_close=on|off][,gl=on|off]|curses|none|\n"
+    "-display gtk[,grab_on_hover=on|off][,gl=on|off]|\n"
+    "-display vnc=<display>[,<optargs>]\n"
+    "-display curses\n"
+    "-display none"
+    "                select display type\n"
+    "If no -display option or its sugars (sd, curses, vnc, etc) defined,"
+    " qemu will implicitly use\n"

Results in a long line of output. You misspelled sdl.

Perhaps simply:

"The default display is equivalent to\n"

qemu-options.hx ETEXI · line 942

Quoted 2 lines
qemu-options.hx +2 -0
+#if defined(CONFIG_GTK)
+            "\t\"-dispaly gtk\"\n"

s/dispaly/display/

Quoted 14 lines
qemu-options.hx +10 -0
+#elif defined(CONFIG_SDL)
+            "\t\"-display sdl\"\n"
+#elif defined(CONFIG_COCOA)
+            "\t\"-display cocoa\"\n"
+#elif defined(CONFIG_VNC)
+            "\t\"-vnc localhost:0,to=99,id=default\"\n"
+#else
+            "\t\"-display none\"\n"
+#endif
+    , QEMU_ARCH_ALL)
 STEXI
 @item -display @var{type}
 @findex -display

qemu-options.hx the console and monitor. · line 1000

Quoted 6 lines
qemu-options.hx +2 -1
@@ -980,7 +996,8 @@ the console and monitor.
 ETEXI
 
 DEF("curses", 0, QEMU_OPTION_curses,
-    "-curses         use a curses/ncurses interface instead of SDL\n",
+    "-curses         use a curses/ncurses interface instead of SDL; "
+    "is sugar for -display curses\n",

Long line of output. Preexisting: the "instead of SDL" part is wrong unless CONFIG_SDL.

What about:

"-curses shorthand for -display curses\n",

qemu-options.hx Disable SDL window close capability. · line 1050

Quoted 9 lines
qemu-options.hx +1 -1
     QEMU_ARCH_ALL)
 STEXI
 @item -curses
@@ -1030,7 +1047,7 @@ Disable SDL window close capability.
 ETEXI
 
 DEF("sdl", 0, QEMU_OPTION_sdl,
-    "-sdl            enable SDL\n", QEMU_ARCH_ALL)
+    "-sdl            enable SDL; is sugar for -display sdl\n", QEMU_ARCH_ALL)

If we change -curses as suggested, then this should become

"-sdl enable SDL; is sugar for -display sdl\n",

for consistency.

qemu-options.hx Set the initial graphical resolution and depth (PPC, SPARC only). · line 1248

Quoted 10 lines
qemu-options.hx +2 -1
 STEXI
 @item -sdl
 @findex -sdl
@@ -1227,7 +1244,8 @@ Set the initial graphical resolution and depth (PPC, SPARC only).
 ETEXI
 
 DEF("vnc", HAS_ARG, QEMU_OPTION_vnc ,
-    "-vnc display    start a VNC server on display\n", QEMU_ARCH_ALL)
+    "-vnc display    start a VNC server on display; is sugar for"
+" -display vnc=display\n", QEMU_ARCH_ALL)

Long line of output.

If we change -curses as suggested, then this should become

-vnc display start a VNC server on display; is sugar for -display vnc=display

"-vnc <display> shorthand for -display vnc=<display>\n",

for consistency.

qemu-options.hx Set the initial graphical resolution and depth (PPC, SPARC only). · line 1251

Quoted 3 lines
qemu-options.hx +0 -0
 STEXI
 @item -vnc @var{display}[,@var{option}[,@var{option}[,...]]]
 @findex -vnc

Thanks for tackling this!