Skip to content

Commit

Permalink
maint: Include bug-reporting info in --help output
Browse files Browse the repository at this point in the history
These days, many programs are including a bug-reporting address,
or better yet, a link to the project web site, at the tail of
their --help output.  However, we were not very consistent at
doing so: only qemu-nbd and qemu-qa mentioned anything, with the
latter pointing to an individual person instead of the project.

Add a new #define that sets up a uniform string, mentioning both
bug reporting instructions and overall project details, and which
a downstream vendor could tweak if they want bugs to go to a
downstream database.  Then use it in all of our binaries which
have --help output.

The canned text intentionally references http:// instead of https://
because our https website currently causes certificate errors in
some browsers.  That can be tweaked later once we have resolved the
web site issued.

Signed-off-by: Eric Blake <[email protected]>
Reviewed-by: Daniel P. Berrange <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
ebblake authored and bonzini committed Aug 8, 2017
1 parent 8f1c29a commit f5048cb
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 7 deletions.
2 changes: 2 additions & 0 deletions bsd-user/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,8 @@ static void usage(void)
" -E var1=val2 -E var2=val2 -U LD_PRELOAD -U LD_DEBUG\n"
"Note that if you provide several changes to single variable\n"
"last change will stay in effect.\n"
"\n"
QEMU_HELP_BOTTOM "\n"
,
TARGET_NAME,
interp_prefix,
Expand Down
5 changes: 5 additions & 0 deletions include/qemu-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
#define QEMU_COPYRIGHT "Copyright (c) 2003-2017 " \
"Fabrice Bellard and the QEMU Project developers"

/* Bug reporting information for --help arguments, About dialogs, etc */
#define QEMU_HELP_BOTTOM \
"See <http://qemu.org/contribute/report-a-bug> for how to report bugs.\n" \
"More information on the QEMU project at <http://qemu.org>."

/* main function, renamed */
#if defined(CONFIG_COCOA)
int qemu_main(int argc, char **argv, char **envp);
Expand Down
4 changes: 3 additions & 1 deletion linux-user/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4136,7 +4136,9 @@ static void usage(int exitcode)
" -E var1=val2,var2=val2 -U LD_PRELOAD,LD_DEBUG\n"
" QEMU_SET_ENV=var1=val2,var2=val2 QEMU_UNSET_ENV=LD_PRELOAD,LD_DEBUG\n"
"Note that if you provide several changes to a single variable\n"
"the last change will stay in effect.\n");
"the last change will stay in effect.\n"
"\n"
QEMU_HELP_BOTTOM "\n");

exit(exitcode);
}
Expand Down
2 changes: 1 addition & 1 deletion qemu-img.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ static void QEMU_NORETURN help(void)

printf("%s\nSupported formats:", help_msg);
bdrv_iterate_format(format_print, NULL);
printf("\n");
printf("\n\n" QEMU_HELP_BOTTOM "\n");
exit(EXIT_SUCCESS);
}

Expand Down
5 changes: 3 additions & 2 deletions qemu-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,9 @@ static void usage(const char *name)
" -h, --help display this help and exit\n"
" -V, --version output version information and exit\n"
"\n"
"See '%s -c help' for information on available commands."
"\n",
"See '%s -c help' for information on available commands.\n"
"\n"
QEMU_HELP_BOTTOM "\n",
name, name);
}

Expand Down
2 changes: 1 addition & 1 deletion qemu-nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ static void usage(const char *name)
" --detect-zeroes=MODE set detect-zeroes mode (off, on, unmap)\n"
" --image-opts treat FILE as a full set of image options\n"
"\n"
"Report bugs to <[email protected]>\n"
QEMU_HELP_BOTTOM "\n"
, name, NBD_DEFAULT_PORT, "DEVICE");
}

Expand Down
2 changes: 1 addition & 1 deletion qga/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ QEMU_COPYRIGHT "\n"
" options / command-line parameters to stdout\n"
" -h, --help display this help and exit\n"
"\n"
"Report bugs to <[email protected]>\n"
QEMU_HELP_BOTTOM "\n"
, cmd, QGA_VIRTIO_PATH_DEFAULT, QGA_SERIAL_PATH_DEFAULT,
dfl_pathnames.pidfile,
#ifdef CONFIG_FSFREEZE
Expand Down
4 changes: 3 additions & 1 deletion vl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1942,7 +1942,9 @@ static void help(int exitcode)
"ctrl-alt-n switch to virtual console 'n'\n"
"ctrl-alt toggle mouse and keyboard grab\n"
"\n"
"When using -nographic, press 'ctrl-a h' to get some help.\n");
"When using -nographic, press 'ctrl-a h' to get some help.\n"
"\n"
QEMU_HELP_BOTTOM "\n");

exit(exitcode);
}
Expand Down

0 comments on commit f5048cb

Please sign in to comment.