mirror of
https://github.com/weechat/weechat.git
synced 2026-07-10 11:43:13 +02:00
Many changes in doc
This commit is contained in:
+64
-35
@@ -1104,22 +1104,28 @@ command_help (void *data, struct t_gui_buffer *buffer,
|
||||
if (ptr_option)
|
||||
{
|
||||
gui_chat_printf (NULL, "");
|
||||
gui_chat_printf (NULL,
|
||||
_("Option \"%s%s%s\": %s"),
|
||||
gui_chat_printf (NULL, _("Option \"%s%s%s\":"),
|
||||
GUI_COLOR(GUI_COLOR_CHAT_CHANNEL),
|
||||
argv[1],
|
||||
GUI_COLOR(GUI_COLOR_CHAT),
|
||||
GUI_COLOR(GUI_COLOR_CHAT));
|
||||
gui_chat_printf (NULL, " %s: %s",
|
||||
_("description"),
|
||||
_(ptr_option->description));
|
||||
switch (ptr_option->type)
|
||||
{
|
||||
case CONFIG_OPTION_TYPE_BOOLEAN:
|
||||
gui_chat_printf (NULL, _(" type: boolean ('on' or 'off')"));
|
||||
gui_chat_printf (NULL, _(" value: %s%s%s (default: %s)"),
|
||||
gui_chat_printf (NULL, " %s: %s",
|
||||
_("type"), _("boolean"));
|
||||
gui_chat_printf (NULL, " %s: on, off",
|
||||
_("values"));
|
||||
gui_chat_printf (NULL, " %s: %s",
|
||||
_("default value"),
|
||||
(CONFIG_BOOLEAN_DEFAULT(ptr_option) == CONFIG_BOOLEAN_TRUE) ?
|
||||
"on" : "off");
|
||||
gui_chat_printf (NULL, " %s: %s%s",
|
||||
_("current value"),
|
||||
GUI_COLOR(GUI_COLOR_CHAT_HOST),
|
||||
(CONFIG_BOOLEAN(ptr_option) == CONFIG_BOOLEAN_TRUE) ?
|
||||
"on" : "off",
|
||||
GUI_COLOR(GUI_COLOR_CHAT),
|
||||
(CONFIG_BOOLEAN_DEFAULT(ptr_option) == CONFIG_BOOLEAN_TRUE) ?
|
||||
"on" : "off");
|
||||
break;
|
||||
case CONFIG_OPTION_TYPE_INTEGER:
|
||||
@@ -1146,60 +1152,83 @@ command_help (void *data, struct t_gui_buffer *buffer,
|
||||
strcat (string, ", ");
|
||||
i++;
|
||||
}
|
||||
gui_chat_printf (NULL, " %s: %s",
|
||||
_("type"), _("string"));
|
||||
gui_chat_printf (NULL, " %s: %s",
|
||||
_("values"), string);
|
||||
gui_chat_printf (NULL, " %s: '%s'",
|
||||
_("default value"),
|
||||
ptr_option->string_values[CONFIG_INTEGER_DEFAULT(ptr_option)]);
|
||||
gui_chat_printf (NULL,
|
||||
_(" type: string (%s)"),
|
||||
string);
|
||||
gui_chat_printf (NULL,
|
||||
_(" value: '%s%s%s' (default: '%s')"),
|
||||
" %s: '%s%s%s'",
|
||||
_("current value"),
|
||||
GUI_COLOR(GUI_COLOR_CHAT_HOST),
|
||||
ptr_option->string_values[CONFIG_INTEGER(ptr_option)],
|
||||
GUI_COLOR(GUI_COLOR_CHAT),
|
||||
ptr_option->string_values[CONFIG_INTEGER_DEFAULT(ptr_option)]);
|
||||
GUI_COLOR(GUI_COLOR_CHAT));
|
||||
free (string);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_chat_printf (NULL, _(" type: integer (between %d and %d)"),
|
||||
ptr_option->min,
|
||||
ptr_option->max);
|
||||
gui_chat_printf (NULL, _(" value: %s%d%s (default: %d)"),
|
||||
GUI_COLOR(GUI_COLOR_CHAT_HOST),
|
||||
CONFIG_INTEGER(ptr_option),
|
||||
GUI_COLOR(GUI_COLOR_CHAT),
|
||||
gui_chat_printf (NULL, " %s: %s",
|
||||
_("type"), _("integer"));
|
||||
gui_chat_printf (NULL, " %s: %d .. %d",
|
||||
_("values"),
|
||||
ptr_option->min, ptr_option->max);
|
||||
gui_chat_printf (NULL, " %s: %d",
|
||||
_("default value"),
|
||||
CONFIG_INTEGER_DEFAULT(ptr_option));
|
||||
gui_chat_printf (NULL, " %s: %s%d",
|
||||
_("current value"),
|
||||
GUI_COLOR(GUI_COLOR_CHAT_HOST),
|
||||
CONFIG_INTEGER(ptr_option));
|
||||
}
|
||||
break;
|
||||
case CONFIG_OPTION_TYPE_STRING:
|
||||
switch (ptr_option->max)
|
||||
{
|
||||
case 0:
|
||||
gui_chat_printf (NULL, _(" type: string (any string)"));
|
||||
gui_chat_printf (NULL, " %s: %s",
|
||||
_("type"), _("string"));
|
||||
gui_chat_printf (NULL, " %s: %s",
|
||||
_("values"), _("any string"));
|
||||
break;
|
||||
case 1:
|
||||
gui_chat_printf (NULL, _(" type: char (any char)"));
|
||||
gui_chat_printf (NULL, " %s: %s",
|
||||
_("type"), _("string"));
|
||||
gui_chat_printf (NULL, " %s: %s",
|
||||
_("values"), _("any char"));
|
||||
break;
|
||||
default:
|
||||
gui_chat_printf (NULL, _(" type: string (limit: %d chars)"),
|
||||
gui_chat_printf (NULL, " %s: %s",
|
||||
_("type"), _("string"));
|
||||
gui_chat_printf (NULL, " %s: %s (%s: %d)",
|
||||
_("values"), _("any string"),
|
||||
_("max chars"),
|
||||
ptr_option->max);
|
||||
break;
|
||||
}
|
||||
gui_chat_printf (NULL,
|
||||
_(" value: '%s%s%s' (default: '%s')"),
|
||||
gui_chat_printf (NULL, " %s: '%s'",
|
||||
_("default value"),
|
||||
CONFIG_STRING_DEFAULT(ptr_option));
|
||||
gui_chat_printf (NULL, " %s: '%s%s%s'",
|
||||
_("current value"),
|
||||
GUI_COLOR(GUI_COLOR_CHAT_HOST),
|
||||
CONFIG_STRING(ptr_option),
|
||||
GUI_COLOR(GUI_COLOR_CHAT),
|
||||
CONFIG_STRING_DEFAULT(ptr_option));
|
||||
GUI_COLOR(GUI_COLOR_CHAT));
|
||||
break;
|
||||
case CONFIG_OPTION_TYPE_COLOR:
|
||||
gui_chat_printf (NULL,
|
||||
_(" type: color (values depend on GUI used)"));
|
||||
gui_chat_printf (NULL,
|
||||
_(" value: %s%s%s (default: %s)"),
|
||||
GUI_COLOR(GUI_COLOR_CHAT_HOST),
|
||||
gui_color_get_name (CONFIG_COLOR(ptr_option)),
|
||||
GUI_COLOR(GUI_COLOR_CHAT),
|
||||
gui_chat_printf (NULL, " %s: %s",
|
||||
_("type"), _("color"));
|
||||
gui_chat_printf (NULL, " %s: %s",
|
||||
_("values"), _("a color name"));
|
||||
gui_chat_printf (NULL, " %s: %s",
|
||||
_("default value"),
|
||||
gui_color_get_name (CONFIG_COLOR_DEFAULT(ptr_option)));
|
||||
gui_chat_printf (NULL, " %s: %s%s",
|
||||
_("current value"),
|
||||
GUI_COLOR(GUI_COLOR_CHAT_HOST),
|
||||
gui_color_get_name (CONFIG_COLOR(ptr_option)));
|
||||
break;
|
||||
case CONFIG_NUM_OPTION_TYPES:
|
||||
break;
|
||||
|
||||
@@ -887,7 +887,7 @@ string_build_with_exploded (char **exploded_string, const char *separator)
|
||||
}
|
||||
|
||||
/*
|
||||
* string_split_command: split a list of commands separated by 'sep'
|
||||
* string_split_command: split a list of commands separated by 'separator'
|
||||
* and ecscaped with '\'
|
||||
* - empty commands are removed
|
||||
* - spaces on the left of each commands are stripped
|
||||
|
||||
+2
-2
@@ -62,7 +62,7 @@ utf8_has_8bits (const char *string)
|
||||
|
||||
/*
|
||||
* utf8_is_valid: return 1 if UTF-8 string is valid, 0 otherwise
|
||||
* if error is not NULL, it's set with first non valid UTF-8
|
||||
* if error is not NULL, it is set with first non valid UTF-8
|
||||
* char in string, if any
|
||||
*/
|
||||
|
||||
@@ -404,7 +404,7 @@ utf8_add_offset (const char *string, int offset)
|
||||
}
|
||||
|
||||
/*
|
||||
* utf8_real_pos: get real position in UTF-8
|
||||
* utf8_real_pos: get real position in UTF-8 string
|
||||
* for example: ("aébc", 2) returns 3
|
||||
*/
|
||||
|
||||
|
||||
+2
-3
@@ -170,13 +170,12 @@ util_create_dir (const char *directory, int permissions)
|
||||
|
||||
void
|
||||
util_exec_on_files (const char *directory, void *data,
|
||||
int (*callback)(void *data, const char *filename))
|
||||
void (*callback)(void *data, const char *filename))
|
||||
{
|
||||
char complete_filename[1024];
|
||||
DIR *dir;
|
||||
struct dirent *entry;
|
||||
struct stat statbuf;
|
||||
int rc;
|
||||
|
||||
if (!directory || !callback)
|
||||
return;
|
||||
@@ -191,7 +190,7 @@ util_exec_on_files (const char *directory, void *data,
|
||||
lstat (complete_filename, &statbuf);
|
||||
if (!S_ISDIR(statbuf.st_mode))
|
||||
{
|
||||
rc = (*callback) (data, complete_filename);
|
||||
(*callback) (data, complete_filename);
|
||||
}
|
||||
}
|
||||
closedir (dir);
|
||||
|
||||
+2
-2
@@ -27,8 +27,8 @@ extern int util_get_time_length (const char *time_format);
|
||||
extern void util_catch_signal (int signum, void (*handler)(int));
|
||||
extern int util_create_dir (const char *directory, int permissions);
|
||||
extern void util_exec_on_files (const char *directory, void *data,
|
||||
int (*callback)(void *data,
|
||||
const char *filename));
|
||||
void (*callback)(void *data,
|
||||
const char *filename));
|
||||
extern char *util_search_full_lib_name (const char *filename,
|
||||
const char *sys_directory);
|
||||
extern int util_weechat_version_cmp (const char *version1,
|
||||
|
||||
Reference in New Issue
Block a user