aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Pärtel <martin.partel@gmail.com>2020-02-12 17:09:22 +0200
committerMartin Pärtel <martin.partel@gmail.com>2020-02-12 17:09:22 +0200
commit4b87500fef925e591b08cb8aea6bf0a21b84dd72 (patch)
treee545cf68f4a4917cf0c2d98d977a616dbb3a6144
parent2c2337b7c9b87744662c4b08d453bf7128444f43 (diff)
downloadbindfs-4b87500fef925e591b08cb8aea6bf0a21b84dd72.tar.gz
Added --fuse-version
-rw-r--r--ChangeLog1
-rw-r--r--src/bindfs.14
-rw-r--r--src/bindfs.c8
3 files changed, 13 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index f22406b..c43126e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
2020-02-12 Martin Pärtel <martin dot partel at gmail dot com>
* Stop adding `-ononempty` when mounting a directory on itself with FUSE 3.
+ * Added --fuse-version.
2020-01-08 Martin Pärtel <martin dot partel at gmail dot com>
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),