summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-07-02 19:29:21 -0700
committerGuy Harris <guy@alum.mit.edu>2014-07-03 02:29:54 +0000
commit6b3391c60ab4302ebe06baaaecad25210b3edbed (patch)
tree6b44da6ea1203c5c5530c93234a60a87fee39c43 /ui
parent66c342ed59ed0e61f0b32c68b8197016a7299a6d (diff)
downloadwireshark-6b3391c60ab4302ebe06baaaecad25210b3edbed.tar.gz
Regularize the help output of programs.
Only print to the standard output, and only give the version information, if a "print help" command-line option is specified. Otherwise, leave out the version information, and print to the standard error. Leave out the copyright information; it's extra cruft, and http://www.gnu.org/prep/standards/html_node/_002d_002dhelp.html doesn't say anything about it (and bash, at least, doesn't print it). Change-Id: Ic5029ccf96e096453f3bd38383cc2dd355542e8a Reviewed-on: https://code.wireshark.org/review/2789 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk/main.c10
-rw-r--r--ui/qt/main.cpp12
2 files changed, 9 insertions, 13 deletions
diff --git a/ui/gtk/main.c b/ui/gtk/main.c
index 9280a9842a..8d6b6de8a3 100644
--- a/ui/gtk/main.c
+++ b/ui/gtk/main.c
@@ -1160,7 +1160,7 @@ file_quit_cmd_cb(GtkWidget *widget _U_, gpointer data _U_)
}
static void
-print_usage(gboolean print_ver) {
+print_usage(gboolean for_help_option) {
FILE *output;
@@ -1168,14 +1168,12 @@ print_usage(gboolean print_ver) {
create_console();
#endif
- if (print_ver) {
+ if (for_help_option) {
output = stdout;
fprintf(output, "Wireshark %s\n"
"Interactively dump and analyze network traffic.\n"
- "See http://www.wireshark.org for more information.\n"
- "\n"
- "%s",
- get_ws_vcs_version_info(), get_copyright_info());
+ "See http://www.wireshark.org for more information.\n",
+ get_ws_vcs_version_info());
} else {
output = stderr;
}
diff --git a/ui/qt/main.cpp b/ui/qt/main.cpp
index 3761af0d7e..05693778ec 100644
--- a/ui/qt/main.cpp
+++ b/ui/qt/main.cpp
@@ -204,21 +204,19 @@ void main_window_quit(void)
// xxx copied from ../gtk/main.c
static void
-print_usage(gboolean print_ver) {
+print_usage(gboolean for_help_option) {
FILE *output;
#ifdef _WIN32
create_console();
#endif
- if (print_ver) {
+ if (for_help_option) {
output = stdout;
fprintf(output, "Wireshark %s\n"
"Interactively dump and analyze network traffic.\n"
- "See http://www.wireshark.org for more information.\n"
- "\n"
- "%s",
- get_ws_vcs_version_info(), get_copyright_info());
+ "See http://www.wireshark.org for more information.\n",
+ get_ws_vcs_version_info());
} else {
output = stderr;
}
@@ -786,7 +784,7 @@ int main(int argc, char *argv[])
cf_name = new QString(optarg);
break;
case '?':
- print_usage(TRUE);
+ print_usage(FALSE);
exit(0);
break;
}