From cda5e8ba4c617c70639777b9d8d66e4f99d43a2f Mon Sep 17 00:00:00 2001 From: szaka Date: Wed, 4 Mar 2009 00:01:21 +0000 Subject: [PATCH] add --version/-V command line option --- src/ntfs-3g.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index 312362c9..1fc509d6 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -2012,11 +2012,12 @@ static int parse_options(int argc, char *argv[]) { int c; - static const char *sopt = "-o:hv"; + static const char *sopt = "-o:hvV"; static const struct option lopt[] = { { "options", required_argument, NULL, 'o' }, { "help", no_argument, NULL, 'h' }, { "verbose", no_argument, NULL, 'v' }, + { "version", no_argument, NULL, 'V' }, { NULL, 0, NULL, 0 } }; @@ -2063,6 +2064,10 @@ static int parse_options(int argc, char *argv[]) * we don't use it because mount(8) passes it. */ break; + case 'V': + ntfs_log_info("%s %s %s %d\n", EXEC_NAME, VERSION, + FUSE_TYPE, fuse_version()); + exit(0); default: ntfs_log_error("%s: Unknown option '%s'.\n", EXEC_NAME, argv[optind - 1]);