314 |
} |
} |
315 |
|
|
316 |
/* |
/* |
317 |
|
* wee_display_key_functions: display WeeChat key functions |
318 |
|
*/ |
319 |
|
|
320 |
|
void wee_display_key_functions () |
321 |
|
{ |
322 |
|
int i; |
323 |
|
|
324 |
|
printf (_("Internal key functions:\n")); |
325 |
|
printf ("\n"); |
326 |
|
i = 0; |
327 |
|
while (gui_key_functions[i].function_name) |
328 |
|
{ |
329 |
|
printf (" %s\n", |
330 |
|
gui_key_functions[i].function_name); |
331 |
|
i++; |
332 |
|
} |
333 |
|
} |
334 |
|
|
335 |
|
/* |
336 |
|
* wee_display_keys: display WeeChat default keys |
337 |
|
*/ |
338 |
|
|
339 |
|
void wee_display_keys () |
340 |
|
{ |
341 |
|
t_gui_key *ptr_key; |
342 |
|
char *expanded_name; |
343 |
|
|
344 |
|
printf (_("%s default keys:\n"), PACKAGE_NAME); |
345 |
|
printf ("\n"); |
346 |
|
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key) |
347 |
|
{ |
348 |
|
expanded_name = gui_key_get_expanded_name (ptr_key->key); |
349 |
|
printf (" %20s => %s\n", |
350 |
|
(expanded_name) ? expanded_name : ptr_key->key, |
351 |
|
(ptr_key->function) ? gui_key_function_search_by_ptr (ptr_key->function) : ptr_key->command); |
352 |
|
if (expanded_name) |
353 |
|
free (expanded_name); |
354 |
|
} |
355 |
|
} |
356 |
|
|
357 |
|
/* |
358 |
* wee_parse_args: parse command line args |
* wee_parse_args: parse command line args |
359 |
*/ |
*/ |
360 |
|
|
374 |
wee_display_config_options (); |
wee_display_config_options (); |
375 |
wee_shutdown (EXIT_SUCCESS); |
wee_shutdown (EXIT_SUCCESS); |
376 |
} |
} |
377 |
|
else if ((strcmp (argv[i], "-f") == 0) |
378 |
|
|| (strcmp (argv[i], "--key-functions") == 0)) |
379 |
|
{ |
380 |
|
wee_display_key_functions (); |
381 |
|
wee_shutdown (EXIT_SUCCESS); |
382 |
|
} |
383 |
else if ((strcmp (argv[i], "-h") == 0) |
else if ((strcmp (argv[i], "-h") == 0) |
384 |
|| (strcmp (argv[i], "--help") == 0)) |
|| (strcmp (argv[i], "--help") == 0)) |
385 |
{ |
{ |
387 |
printf ("%s", WEE_USAGE2); |
printf ("%s", WEE_USAGE2); |
388 |
wee_shutdown (EXIT_SUCCESS); |
wee_shutdown (EXIT_SUCCESS); |
389 |
} |
} |
390 |
if ((strcmp (argv[i], "-i") == 0) |
else if ((strcmp (argv[i], "-i") == 0) |
391 |
|| (strcmp (argv[i], "--irc-commands") == 0)) |
|| (strcmp (argv[i], "--irc-commands") == 0)) |
392 |
{ |
{ |
393 |
wee_display_commands (0, 1); |
wee_display_commands (0, 1); |
394 |
wee_shutdown (EXIT_SUCCESS); |
wee_shutdown (EXIT_SUCCESS); |
395 |
} |
} |
396 |
|
else if ((strcmp (argv[i], "-k") == 0) |
397 |
|
|| (strcmp (argv[i], "--keys") == 0)) |
398 |
|
{ |
399 |
|
wee_display_keys (); |
400 |
|
wee_shutdown (EXIT_SUCCESS); |
401 |
|
} |
402 |
else if ((strcmp (argv[i], "-l") == 0) |
else if ((strcmp (argv[i], "-l") == 0) |
403 |
|| (strcmp (argv[i], "--license") == 0)) |
|| (strcmp (argv[i], "--license") == 0)) |
404 |
{ |
{ |
411 |
printf (PACKAGE_VERSION "\n"); |
printf (PACKAGE_VERSION "\n"); |
412 |
wee_shutdown (EXIT_SUCCESS); |
wee_shutdown (EXIT_SUCCESS); |
413 |
} |
} |
414 |
if ((strcmp (argv[i], "-w") == 0) |
else if ((strcmp (argv[i], "-w") == 0) |
415 |
|| (strcmp (argv[i], "--weechat-commands") == 0)) |
|| (strcmp (argv[i], "--weechat-commands") == 0)) |
416 |
{ |
{ |
417 |
wee_display_commands (1, 0); |
wee_display_commands (1, 0); |
824 |
signal (SIGSEGV, my_sigsegv); /* crash dump when SIGSEGV is received */ |
signal (SIGSEGV, my_sigsegv); /* crash dump when SIGSEGV is received */ |
825 |
gui_pre_init (&argc, &argv); /* pre-initiliaze interface */ |
gui_pre_init (&argc, &argv); /* pre-initiliaze interface */ |
826 |
wee_init_vars (); /* initialize some variables */ |
wee_init_vars (); /* initialize some variables */ |
827 |
|
gui_key_init (); /* init keyboard (default key bindings) */ |
828 |
wee_parse_args (argc, argv); /* parse command line args */ |
wee_parse_args (argc, argv); /* parse command line args */ |
829 |
wee_create_home_dirs (); /* create WeeChat directories */ |
wee_create_home_dirs (); /* create WeeChat directories */ |
830 |
wee_init_log (); /* init log file */ |
wee_init_log (); /* init log file */ |