135 |
"For each argument, '*' means all.\n" |
"For each argument, '*' means all.\n" |
136 |
"Without argument, /unignore command lists all defined ignore."), |
"Without argument, /unignore command lists all defined ignore."), |
137 |
0, 4, weechat_cmd_unignore, NULL }, |
0, 4, weechat_cmd_unignore, NULL }, |
138 |
|
{ "uptime", N_("show WeeChat uptime"), |
139 |
|
N_("-o"), |
140 |
|
N_("-o: send uptime on current channel as an IRC message"), |
141 |
|
0, 1, weechat_cmd_uptime, NULL }, |
142 |
{ "window", N_("manage windows"), |
{ "window", N_("manage windows"), |
143 |
N_("[list | -1 | +1 | b# | splith | splitv | [merge [down | up | left | right | all]]]"), |
N_("[list | -1 | +1 | b# | splith | splitv | [merge [down | up | left | right | all]]]"), |
144 |
N_("list: list opened windows (no parameter implies this list)\n" |
N_("list: list opened windows (no parameter implies this list)\n" |
2641 |
} |
} |
2642 |
|
|
2643 |
return 0; |
return 0; |
2644 |
|
} |
2645 |
|
|
2646 |
|
/* |
2647 |
|
* weechat_cmd_uptime: display WeeChat uptime |
2648 |
|
*/ |
2649 |
|
|
2650 |
|
int |
2651 |
|
weechat_cmd_uptime (int argc, char **argv) |
2652 |
|
{ |
2653 |
|
time_t running_time; |
2654 |
|
int day, hour, min, sec; |
2655 |
|
char string[256]; |
2656 |
|
|
2657 |
|
running_time = time (NULL) - weechat_start_time; |
2658 |
|
day = running_time / (60 * 60 * 24); |
2659 |
|
hour = (running_time % (60 * 60 * 24)) / (60 * 60); |
2660 |
|
min = ((running_time % (60 * 60 * 24)) % (60 * 60)) / 60; |
2661 |
|
sec = ((running_time % (60 * 60 * 24)) % (60 * 60)) % 60; |
2662 |
|
|
2663 |
|
if ((argc == 1) && (strcmp (argv[0], "-o") == 0) |
2664 |
|
&& ((BUFFER_IS_CHANNEL(gui_current_window->buffer)) |
2665 |
|
|| (BUFFER_IS_PRIVATE(gui_current_window->buffer)))) |
2666 |
|
{ |
2667 |
|
snprintf (string, sizeof (string), |
2668 |
|
"WeeChat uptime: %d %s %02d:%02d:%02d, started on %s", |
2669 |
|
day, |
2670 |
|
(day > 1) ? _("days") : _("day"), |
2671 |
|
hour, |
2672 |
|
min, |
2673 |
|
sec, |
2674 |
|
ctime (&weechat_start_time)); |
2675 |
|
string[strlen (string) - 1] = '\0'; |
2676 |
|
user_command (SERVER(gui_current_window->buffer), |
2677 |
|
gui_current_window->buffer, |
2678 |
|
string); |
2679 |
|
} |
2680 |
|
else |
2681 |
|
{ |
2682 |
|
irc_display_prefix (NULL, gui_current_window->buffer, |
2683 |
|
PREFIX_INFO); |
2684 |
|
gui_printf_nolog (gui_current_window->buffer, |
2685 |
|
_("WeeChat uptime: %s%d %s%s " |
2686 |
|
"%s%02d%s:%s%02d%s:%s%02d%s, " |
2687 |
|
"started on %s%s"), |
2688 |
|
GUI_COLOR(COLOR_WIN_CHAT_CHANNEL), |
2689 |
|
day, |
2690 |
|
GUI_COLOR(COLOR_WIN_CHAT), |
2691 |
|
(day > 1) ? _("days") : _("day"), |
2692 |
|
GUI_COLOR(COLOR_WIN_CHAT_CHANNEL), |
2693 |
|
hour, |
2694 |
|
GUI_COLOR(COLOR_WIN_CHAT), |
2695 |
|
GUI_COLOR(COLOR_WIN_CHAT_CHANNEL), |
2696 |
|
min, |
2697 |
|
GUI_COLOR(COLOR_WIN_CHAT), |
2698 |
|
GUI_COLOR(COLOR_WIN_CHAT_CHANNEL), |
2699 |
|
sec, |
2700 |
|
GUI_COLOR(COLOR_WIN_CHAT), |
2701 |
|
GUI_COLOR(COLOR_WIN_CHAT_CHANNEL), |
2702 |
|
ctime (&weechat_start_time)); |
2703 |
|
} |
2704 |
|
|
2705 |
|
return 0; |
2706 |
} |
} |
2707 |
|
|
2708 |
/* |
/* |