/[weechat]/weechat/src/common/weechat.c
ViewVC logotype

Diff of /weechat/src/common/weechat.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.36 by flashcode, Sun Mar 6 20:56:24 2005 UTC revision 1.37 by flashcode, Thu Mar 10 15:40:18 2005 UTC
# Line 248  void wee_display_config_options () Line 248  void wee_display_config_options ()
248  }  }
249    
250  /*  /*
251     * wee_display_commands: display WeeChat and/or IRC commands
252     */
253    
254    void wee_display_commands (int weechat_cmd, int irc_cmd)
255    {
256        int i;
257        
258        if (weechat_cmd)
259        {
260            printf (_("%s internal commands:\n"), PACKAGE_NAME);
261            printf ("\n");
262            for (i = 0; weechat_commands[i].command_name; i++)
263            {
264                printf ("* %s", weechat_commands[i].command_name);
265                if (weechat_commands[i].arguments &&
266                    weechat_commands[i].arguments[0])
267                    printf ("  %s\n", _(weechat_commands[i].arguments));
268                else
269                    printf ("\n");
270                if (weechat_commands[i].arguments_description &&
271                    weechat_commands[i].arguments_description[0])
272                    printf ("\n%s\n\n",
273                        _(weechat_commands[i].arguments_description));
274            }
275        }
276        
277        if (irc_cmd)
278        {
279            printf (_("IRC commands:\n"));
280            printf ("\n");
281            for (i = 0; irc_commands[i].command_name; i++)
282            {
283                if (irc_commands[i].cmd_function_args ||
284                    irc_commands[i].cmd_function_1arg)
285                {
286                    printf ("* %s", irc_commands[i].command_name);
287                    if (irc_commands[i].arguments &&
288                        irc_commands[i].arguments[0])
289                        printf ("  %s\n", _(irc_commands[i].arguments));
290                    else
291                        printf ("\n");
292                    if (irc_commands[i].arguments_description &&
293                        irc_commands[i].arguments_description[0])
294                        printf ("\n%s\n\n",
295                            _(irc_commands[i].arguments_description));
296                }
297            }
298        }
299    }
300    
301    /*
302   * wee_parse_args: parse command line args   * wee_parse_args: parse command line args
303   */   */
304    
# Line 274  wee_parse_args (int argc, char *argv[]) Line 325  wee_parse_args (int argc, char *argv[])
325              printf ("%s", WEE_USAGE2);              printf ("%s", WEE_USAGE2);
326              wee_shutdown (EXIT_SUCCESS);              wee_shutdown (EXIT_SUCCESS);
327          }          }
328            if ((strcmp (argv[i], "-i") == 0)
329                || (strcmp (argv[i], "--irc-commands") == 0))
330            {
331                wee_display_commands (0, 1);
332                wee_shutdown (EXIT_SUCCESS);
333            }
334          else if ((strcmp (argv[i], "-l") == 0)          else if ((strcmp (argv[i], "-l") == 0)
335                   || (strcmp (argv[i], "--license") == 0))                   || (strcmp (argv[i], "--license") == 0))
336          {          {
# Line 286  wee_parse_args (int argc, char *argv[]) Line 343  wee_parse_args (int argc, char *argv[])
343              printf (PACKAGE_VERSION "\n");              printf (PACKAGE_VERSION "\n");
344              wee_shutdown (EXIT_SUCCESS);              wee_shutdown (EXIT_SUCCESS);
345          }          }
346            if ((strcmp (argv[i], "-w") == 0)
347                || (strcmp (argv[i], "--weechat-commands") == 0))
348            {
349                wee_display_commands (1, 0);
350                wee_shutdown (EXIT_SUCCESS);
351            }
352          else if ((strncasecmp (argv[i], "irc://", 6) == 0))          else if ((strncasecmp (argv[i], "irc://", 6) == 0))
353          {          {
354              if (server_init_with_url (argv[i], &server_tmp) < 0)              if (server_init_with_url (argv[i], &server_tmp) < 0)

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26