diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2012-12-16 23:07:33 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2012-12-16 23:07:33 +0100 |
commit | 2b78673aa9717871e993212949287fdd8d0bb033 (patch) | |
tree | cf5ffdc86b646620c2095d6f6f525beda7eb3a25 /src/plugins | |
parent | fc0b73207b51eed495e35ac5f341c8b4d1ee4f40 (diff) | |
download | weechat-2b78673aa9717871e993212949287fdd8d0bb033.zip |
core: add git version in build, display it in "weechat-curses --help" and /version
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/plugin-api.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/plugins/plugin-api.c b/src/plugins/plugin-api.c index e62f1fce4..f4953d59f 100644 --- a/src/plugins/plugin-api.c +++ b/src/plugins/plugin-api.c @@ -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, |