Now prints version number at startup

This commit is contained in:
Fufu Fang 2021-08-31 14:00:47 +01:00
parent f42264d3c3
commit 1e98b16602
No known key found for this signature in database
GPG Key ID: 0F6BB5EF6F8BB729
4 changed files with 21 additions and 12 deletions

View File

@ -70,4 +70,7 @@ void Config_init(void)
CONFIG.sonic_id3 = 0;
CONFIG.sonic_insecure = 0;
/*---------- Print version number -----------*/
print_version();
}

View File

@ -3,6 +3,8 @@
#include "config.h"
#include "util.h"
#include <curl/curl.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
@ -53,4 +55,15 @@ log_printf(LogType type, const char *file, const char *func, int line,
exit_failure();
}
}
}
void print_version()
{
/* FUSE prints its help to stderr */
lprintf(info, "HTTPDirFS version " VERSION "\n");
/*
* --------- Print off SSL engine version ---------
*/
curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
lprintf(info, "libcurl SSL engine: %s\n", data->ssl_version);
}

View File

@ -39,3 +39,8 @@ void log_printf(LogType type, const char *file, const char *func, int line,
#define lprintf(type, ...) \
log_printf(type, __FILE__, __func__, __LINE__, __VA_ARGS__);
#endif
/**
* \brief Print the version information for HTTPDirFS
*/
void print_version();

View File

@ -10,7 +10,6 @@
void add_arg(char ***fuse_argv_ptr, int *fuse_argc, char *opt_string);
static void print_help(char *program_name, int long_help);
static void print_version();
static void print_long_help();
static int
parse_arg_list(int argc, char **argv, char ***fuse_argv, int *fuse_argc);
@ -331,17 +330,6 @@ static void print_help(char *program_name, int long_help)
}
}
static void print_version()
{
/* FUSE prints its help to stderr */
fprintf(stderr, "HTTPDirFS version " VERSION "\n");
/*
* --------- Print off SSL engine version ---------
*/
curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
fprintf(stderr, "libcurl SSL engine: %s\n", data->ssl_version);
}
static void print_long_help()
{
/* FUSE prints its help to stderr */