1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 04:46:37 +02:00

core: add git version in build, display it in "weechat-curses --help" and /version

This commit is contained in:
Sebastien Helleu
2012-12-16 23:07:33 +01:00
parent fc0b73207b
commit 2b78673aa9
38 changed files with 425 additions and 70 deletions
+13 -3
View File
@@ -43,6 +43,7 @@
#include "../core/wee-string.h"
#include "../core/wee-url.h"
#include "../core/wee-util.h"
#include "../core/wee-version.h"
#include "../gui/gui-bar.h"
#include "../gui/gui-bar-item.h"
#include "../gui/gui-bar-window.h"
@@ -295,20 +296,24 @@ plugin_api_info_get_internal (void *data, const char *info_name,
if (string_strcasecmp (info_name, "version") == 0)
{
return PACKAGE_VERSION;
return version_get_version ();
}
else if (string_strcasecmp (info_name, "version_number") == 0)
{
if (!version_number[0])
{
snprintf (version_number, sizeof (version_number), "%d",
util_version_number (PACKAGE_VERSION));
util_version_number (version_get_version ()));
}
return version_number;
}
else if (string_strcasecmp (info_name, "version_git") == 0)
{
return version_get_git ();
}
else if (string_strcasecmp (info_name, "date") == 0)
{
return __DATE__;
return version_get_compilation_date ();
}
else if (string_strcasecmp (info_name, "dir_separator") == 0)
{
@@ -1023,6 +1028,11 @@ plugin_api_init ()
&plugin_api_info_get_internal, NULL);
hook_info (NULL, "version_number", N_("WeeChat version (as number)"), NULL,
&plugin_api_info_get_internal, NULL);
hook_info (NULL, "version_git", N_("WeeChat git version (output of "
"command \"git describe\" for a "
"development version only, empty for a "
"stable release)"), NULL,
&plugin_api_info_get_internal, NULL);
hook_info (NULL, "date", N_("WeeChat compilation date"), NULL,
&plugin_api_info_get_internal, NULL);
hook_info (NULL, "dir_separator", N_("directory separator"), NULL,