From 4b87500fef925e591b08cb8aea6bf0a21b84dd72 Mon Sep 17 00:00:00 2001 From: Martin Pärtel Date: Wed, 12 Feb 2020 17:09:22 +0200 Subject: Added --fuse-version --- src/bindfs.1 | 4 ++++ src/bindfs.c | 8 ++++++++ 2 files changed, 12 insertions(+) (limited to 'src') diff --git a/src/bindfs.1 b/src/bindfs.1 index 6f24267..90b3d8c 100644 --- a/src/bindfs.1 +++ b/src/bindfs.1 @@ -302,6 +302,10 @@ Displays a help message and exits. .B \-V, \-\-version Displays version information and exits. +.B \-\-fuse\-version +Displays the version of the FUSE library interface that was seen at compile-time, +as well as the version that bindfs currently runs with. + .TP .B \-\-no\-allow\-other, \-o no\-allow\-other Does not add \fB\-o allow_other\fP to FUSE options. diff --git a/src/bindfs.c b/src/bindfs.c index 6051f2d..870a650 100644 --- a/src/bindfs.c +++ b/src/bindfs.c @@ -1533,6 +1533,7 @@ static void print_usage(const char *progname) "Information:\n" " -h --help Print this and exit.\n" " -V --version Print version number and exit.\n" + " --fuse-version Print version of FUSE library.\n" "\n" "File ownership:\n" " -u --force-user=... Set file owner.\n" @@ -1618,6 +1619,7 @@ enum OptionKey { OPTKEY_UNKNOWN = -1, OPTKEY_HELP, OPTKEY_VERSION, + OPTKEY_FUSE_VERSION, OPTKEY_CREATE_AS_USER, OPTKEY_CREATE_AS_MOUNTER, OPTKEY_CHOWN_NORMAL, @@ -1658,6 +1660,11 @@ static int process_option(void *data, const char *arg, int key, printf("%s\n", PACKAGE_STRING); exit(0); + case OPTKEY_FUSE_VERSION: + printf("libfuse interface compile-time version %d.%d\n", FUSE_MAJOR_VERSION, FUSE_MINOR_VERSION); + printf("libfuse interface linked version %d.%d\n", fuse_version() / 10, fuse_version() % 10); + exit(0); + case OPTKEY_CREATE_AS_USER: if (getuid() == 0) { settings.create_policy = CREATE_AS_USER; @@ -2042,6 +2049,7 @@ int main(int argc, char *argv[]) static const struct fuse_opt options[] = { OPT2("-h", "--help", OPTKEY_HELP), OPT2("-V", "--version", OPTKEY_VERSION), + FUSE_OPT_KEY("--fuse-version", OPTKEY_FUSE_VERSION), OPT_OFFSET3("-u %s", "--force-user=%s", "force-user=%s", user, -1), OPT_OFFSET3("-g %s", "--force-group=%s", "force-group=%s", group, -1), -- cgit v1.2.3