Mercurial > pidgin.yaz
comparison src/gaim-remote.c @ 10395:b4b9dabdd7c7
[gaim-migrate @ 11624]
Some whitespace fixes, a compile warning fix, and add a "logout" option
to gaim-remote
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Fri, 17 Dec 2004 23:30:38 +0000 |
parents | 1a91e814e9d8 |
children |
comparison
equal
deleted
inserted
replaced
10394:45a0a07e8b25 | 10395:b4b9dabdd7c7 |
---|---|
63 * We try to convert "text" from UTF-8 to the user's locale. | 63 * We try to convert "text" from UTF-8 to the user's locale. |
64 * If that fails then UTF-8 is used as a fallback. | 64 * If that fails then UTF-8 is used as a fallback. |
65 * | 65 * |
66 * If channel is 1, the message is printed to stdout. | 66 * If channel is 1, the message is printed to stdout. |
67 * if channel is 2, the message is printed to stderr. | 67 * if channel is 2, the message is printed to stderr. |
68 */ | 68 */ |
69 static void | 69 static void |
70 message(char *text, int channel) | 70 message(char *text, int channel) |
71 { | 71 { |
72 char *text_conv = NULL,*text_output; | 72 char *text_conv = NULL,*text_output; |
73 GError *error = NULL; | 73 GError *error = NULL; |
101 { | 101 { |
102 char *text = NULL; | 102 char *text = NULL; |
103 | 103 |
104 text = g_strdup_printf(_("Usage: %s command [OPTIONS] [URI]\n\n" | 104 text = g_strdup_printf(_("Usage: %s command [OPTIONS] [URI]\n\n" |
105 " COMMANDS:\n" | 105 " COMMANDS:\n" |
106 " send Send message\n" | |
106 " uri Handle AIM: URI\n" | 107 " uri Handle AIM: URI\n" |
107 " away Popup the away dialog with the default message\n" | 108 " away Popup the away dialog with the default message\n" |
108 " back Remove the away dialog\n" | 109 " back Remove the away dialog\n" |
109 " send Send message\n" | 110 " logout Log out all accounts\n" |
110 " quit Close running copy of Gaim\n\n" | 111 " quit Close running copy of Gaim\n" |
112 "\n" | |
111 " OPTIONS:\n" | 113 " OPTIONS:\n" |
112 " -m, --message=MESG Message to send or show in conversation window\n" | 114 " -m, --message=MESG Message to send or show in conversation window\n" |
113 " -t, --to=SCREENNAME Select a target for command\n" | 115 " -t, --to=SCREENNAME Select a target for command\n" |
114 " -p, --protocol=PROTO Specify protocol to use\n" | 116 " -p, --protocol=PROTO Specify protocol to use\n" |
115 " -f, --from=SCREENNAME Specify screen name to use\n" | 117 " -f, --from=SCREENNAME Specify screen name to use\n" |
305 "Adding a buddy to your buddy list:\n" | 307 "Adding a buddy to your buddy list:\n" |
306 " gaim-remote uri 'aim:addbuddy?screenname=Penguin'\n" | 308 " gaim-remote uri 'aim:addbuddy?screenname=Penguin'\n" |
307 "...prompts you to add 'Penguin' to your buddy list.\n"), 1); | 309 "...prompts you to add 'Penguin' to your buddy list.\n"), 1); |
308 } | 310 } |
309 | 311 |
312 else if (!strcmp(command, "logout")) { | |
313 message(_("\nLog out all accounts\n"), 1); | |
314 } | |
315 | |
310 else if (!strcmp(command, "quit")) { | 316 else if (!strcmp(command, "quit")) { |
311 message(_("\nClose running copy of Gaim\n"), 1); | 317 message(_("\nClose running copy of Gaim\n"), 1); |
312 } | 318 } |
313 | 319 |
314 else if (!strcmp(command, "away")) { | 320 else if (!strcmp(command, "away")) { |
368 show_longhelp(argv[0], "back"); | 374 show_longhelp(argv[0], "back"); |
369 else | 375 else |
370 return send_generic_command(CUI_TYPE_USER, CUI_USER_BACK); | 376 return send_generic_command(CUI_TYPE_USER, CUI_USER_BACK); |
371 } | 377 } |
372 | 378 |
379 else if (!strcmp(opts.command, "logout")) { | |
380 if (opts.help) | |
381 show_longhelp(argv[0], "logout"); | |
382 else | |
383 return send_generic_command(CUI_TYPE_USER, CUI_USER_LOGOUT); | |
384 } | |
385 | |
373 else if (!strcmp(opts.command, "quit")) { | 386 else if (!strcmp(opts.command, "quit")) { |
374 if (opts.help) | 387 if (opts.help) |
375 show_longhelp(argv[0], "quit"); | 388 show_longhelp(argv[0], "quit"); |
376 else | 389 else |
377 return send_generic_command(CUI_TYPE_META, CUI_META_QUIT); | 390 return send_generic_command(CUI_TYPE_META, CUI_META_QUIT); |
379 | 392 |
380 else { | 393 else { |
381 show_remote_usage(argv[0]); | 394 show_remote_usage(argv[0]); |
382 return 1; | 395 return 1; |
383 } | 396 } |
384 | 397 |
385 return 0; | 398 return 0; |
386 } | 399 } |