Skip to contentSkip to conversation

Put the copyright information on a separate line

PATCH Applied Thomas Huth 4 participants 4 messages Oct 5, 2016 – Oct 10, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Put the copyright information on a separate line

The output string QEMU with "--version" is very long, it does not fit into a normal line of a terminal window anymore. By putting the copyright information on a separate line instead, the output looks much nicer.

---
Note: I'm not sure whether there is a technical or legal reason that the copyright information has to be on the same line as the version information, but if there is no such reason, I think a separate line looks much nicer here.

 bsd-user/main.c   | 2 +-
 linux-user/main.c | 2 +-
 qemu-img.c        | 2 +-
 vl.c              | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
bsd-user/main.c +1 -1
index d803d3e..cd8ba64 100644
@@ -651,7 +651,7 @@ void cpu_loop(CPUSPARCState *env)
 static void usage(void)
 {
     printf("qemu-" TARGET_NAME " version " QEMU_VERSION QEMU_PKGVERSION
-           ", " QEMU_COPYRIGHT "\n"
+           "\n" QEMU_COPYRIGHT "\n"
            "usage: qemu-" TARGET_NAME " [options] program [arguments...]\n"
            "BSD CPU emulator (compiled for %s emulation)\n"
            "\n"
linux-user/main.c +1 -1
index 9e4b430..1be24d9 100644
@@ -3936,7 +3936,7 @@ static void handle_arg_strace(const char *arg)
 static void handle_arg_version(const char *arg)
 {
     printf("qemu-" TARGET_NAME " version " QEMU_VERSION QEMU_PKGVERSION
-           ", " QEMU_COPYRIGHT "\n");
+           "\n" QEMU_COPYRIGHT "\n");
     exit(EXIT_SUCCESS);
 }
 
qemu-img.c +1 -1
index ceffefe..7e05349 100644
@@ -44,7 +44,7 @@
 #include <getopt.h>
 
 #define QEMU_IMG_VERSION "qemu-img version " QEMU_VERSION QEMU_PKGVERSION \
-                          ", " QEMU_COPYRIGHT "\n"
+                          "\n" QEMU_COPYRIGHT "\n"
 
 typedef struct img_cmd_t {
     const char *name;
vl.c +1 -1
index f3abd99..4dd6399 100644
@@ -1954,7 +1954,7 @@ static void main_loop(void)
 
 static void version(void)
 {
-    printf("QEMU emulator version " QEMU_VERSION QEMU_PKGVERSION ", "
+    printf("QEMU emulator version " QEMU_VERSION QEMU_PKGVERSION "\n"
            QEMU_COPYRIGHT "\n");
 }
 
Signature · 1 line
1.8.3.1
Acked-by on v1 1/1
#1 lore raw

Am 05.10.2016 um 11:54 hat Thomas Huth geschrieben:

Quoted 6 lines

The output string QEMU with "--version" is very long, it does not fit into a normal line of a terminal window anymore. By putting the copyright information on a separate line instead, the output looks much nicer.

Is this something for qemu-trivial?

Kevin

Reviewed-by on v1 1/1
#2 lore raw
In reply to Thomas Huth
Quoted 11 lines · Thomas Huth

The output string QEMU with "--version" is very long, it does not fit into a normal line of a terminal window anymore. By putting the copyright information on a separate line instead, the output looks much nicer.

---
Note: I'm not sure whether there is a technical or legal reason that the copyright information has to be on the same line as the version information, but if there is no such reason, I think a separate line looks much nicer here.

There's precedent for separate lines of information (to wit, 'ls --version' is the first thing I compared against), so I doubt there's any legal reason (at any rate, if legality were an issue, I'm sure that more programs would have run into that reason and adjusted to be single-line output). The only technical reason for a long line would be for machine parsing, but we recommend (and libvirt uses) QMP for machine-parseable version number information, rather than scraping --version. So I'm in favor of this.

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#3 lore raw
In reply to Thomas Huth
Quoted 63 lines · Thomas Huth

The output string QEMU with "--version" is very long, it does not fit into a normal line of a terminal window anymore. By putting the copyright information on a separate line instead, the output looks much nicer.

---
Note: I'm not sure whether there is a technical or legal reason that the copyright information has to be on the same line as the version information, but if there is no such reason, I think a separate line looks much nicer here.

 bsd-user/main.c   | 2 +-
 linux-user/main.c | 2 +-
 qemu-img.c        | 2 +-
 vl.c              | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
bsd-user/main.c +1 -1
index d803d3e..cd8ba64 100644
@@ -651,7 +651,7 @@ void cpu_loop(CPUSPARCState *env)
 static void usage(void)
 {
     printf("qemu-" TARGET_NAME " version " QEMU_VERSION QEMU_PKGVERSION
-           ", " QEMU_COPYRIGHT "\n"
+           "\n" QEMU_COPYRIGHT "\n"
            "usage: qemu-" TARGET_NAME " [options] program [arguments...]\n"
            "BSD CPU emulator (compiled for %s emulation)\n"
            "\n"
linux-user/main.c +1 -1
index 9e4b430..1be24d9 100644
@@ -3936,7 +3936,7 @@ static void handle_arg_strace(const char *arg)
 static void handle_arg_version(const char *arg)
 {
     printf("qemu-" TARGET_NAME " version " QEMU_VERSION QEMU_PKGVERSION
-           ", " QEMU_COPYRIGHT "\n");
+           "\n" QEMU_COPYRIGHT "\n");
     exit(EXIT_SUCCESS);
 }
 
qemu-img.c +1 -1
index ceffefe..7e05349 100644
@@ -44,7 +44,7 @@
 #include <getopt.h>
 
 #define QEMU_IMG_VERSION "qemu-img version " QEMU_VERSION QEMU_PKGVERSION \
-                          ", " QEMU_COPYRIGHT "\n"
+                          "\n" QEMU_COPYRIGHT "\n"
 
 typedef struct img_cmd_t {
     const char *name;
vl.c +0 -0
index f3abd99..4dd6399 100644

vl.c static void main_loop(void) · line 1960

Quoted 8 lines
vl.c +1 -1
@@ -1954,7 +1954,7 @@ static void main_loop(void)
 
 static void version(void)
 {
-    printf("QEMU emulator version " QEMU_VERSION QEMU_PKGVERSION ", "
+    printf("QEMU emulator version " QEMU_VERSION QEMU_PKGVERSION "\n"
            QEMU_COPYRIGHT "\n");
 }
 

Queued, thanks.

Paolo