cpw.darkrain42.2.6.1: 01851688: Split the descriptions of our --help tex...

markdoliner at pidgin.im markdoliner at pidgin.im
Sun Aug 9 19:15:42 EDT 2009


-----------------------------------------------------------------
Revision: 01851688f60a02b8bb9f189f073225a02339b3aa
Ancestor: e67b54aabe9ebc9c52b091eb993336885ad48209
Author: markdoliner at pidgin.im
Date: 2009-08-09T23:11:59
Branch: im.pidgin.cpw.darkrain42.2.6.1
URL: http://d.pidgin.im/viewmtn/revision/info/01851688f60a02b8bb9f189f073225a02339b3aa

Modified files:
        pidgin/gtkmain.c

ChangeLog: 

Split the descriptions of our --help text up into multiple smaller
strings.  This also doesn't allow translators to translate the
parameters, since that would break them.  It seems like it would be
good if those strings were translatable, too, but that's a bigger
change than I'm willing to make right now.

This also eliminates the two almost identical blocks of text we
had in order to not show the --display option in Windows.

-------------- next part --------------
============================================================
--- pidgin/gtkmain.c	957baa567ba04f3f508ccce8ad6bc0c3f82cf121
+++ pidgin/gtkmain.c	f76d5bf2210a9dfccc64a3785f45be62b071d5e9
@@ -406,34 +406,34 @@ show_usage(const char *name, gboolean te
 	if (terse) {
 		text = g_strdup_printf(_("%s %s. Try `%s -h' for more information.\n"), PIDGIN_NAME, DISPLAY_VERSION, name);
 	} else {
+		GString *str = g_string_new(NULL);
+		g_string_append_printf(str, "%s %s\n", PIDGIN_NAME, DISPLAY_VERSION);
+		g_string_append_printf(str, _("Usage: %s [OPTION]...\n\n"), name);
+		g_string_append_printf(str, "  -c, --config=DIR    %s\n",
+				_("use DIR for config files"));
+		g_string_append_printf(str, "  -d, --debug         %s\n",
+				_("print debugging messages to stdout"));
+		g_string_append_printf(str, "  -f, --force-online  %s\n",
+				_("force online, regardless of network status"));
+		g_string_append_printf(str, "  -h, --help          %s\n",
+				_("display this help and exit"));
+		g_string_append_printf(str, "  -m, --multiple      %s\n",
+				_("allow multiple instances"));
+		g_string_append_printf(str, "  -n, --nologin       %s\n",
+				_("don't automatically login"));
+		g_string_append_printf(str, "  -l, --login[=NAME]  %s\n",
+				_("enable specified account(s) (optional argument NAME\n"
+				  "                      "
+				  "specifies account(s) to use, separated by commas."));
+		g_string_append_printf(str, "                      %s\n",
+				_("Without this only the first account will be enabled)."));
 #ifndef WIN32
-		text = g_strdup_printf(_("%s %s\n"
-		       "Usage: %s [OPTION]...\n\n"
-		       "  -c, --config=DIR    use DIR for config files\n"
-		       "  -d, --debug         print debugging messages to stdout\n"
-		       "  -f, --force-online  force online, regardless of network status\n"
-		       "  -h, --help          display this help and exit\n"
-		       "  -m, --multiple      do not ensure single instance\n"
-		       "  -n, --nologin       don't automatically login\n"
-		       "  -l, --login[=NAME]  enable specified account(s) (optional argument NAME\n"
-		       "                      specifies account(s) to use, separated by commas.\n"
-		       "                      Without this only the first account will be enabled).\n"
-		       "  --display=DISPLAY   X display to use\n"
-		       "  -v, --version       display the current version and exit\n"), PIDGIN_NAME, DISPLAY_VERSION, name);
-#else
-		text = g_strdup_printf(_("%s %s\n"
-		       "Usage: %s [OPTION]...\n\n"
-		       "  -c, --config=DIR    use DIR for config files\n"
-		       "  -d, --debug         print debugging messages to stdout\n"
-		       "  -f, --force-online  force online, regardless of network status\n"
-		       "  -h, --help          display this help and exit\n"
-		       "  -m, --multiple      do not ensure single instance\n"
-		       "  -n, --nologin       don't automatically login\n"
-		       "  -l, --login[=NAME]  enable specified account(s) (optional argument NAME\n"
-		       "                      specifies account(s) to use, separated by commas.\n"
-		       "                      Without this only the first account will be enabled).\n"
-		       "  -v, --version       display the current version and exit\n"), PIDGIN_NAME, DISPLAY_VERSION, name);
-#endif
+		g_string_append_printf(str, "  --display=DISPLAY   %s\n",
+				_("X display to use"));
+#endif /* !WIN32 */
+		g_string_append_printf(str, "  -v, --version       %s\n",
+				_("display the current version and exit"));
+		text = g_string_free(str, FALSE);
 	}
 
 	purple_print_utf8_to_console(stdout, text);


More information about the Commits mailing list