summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-02-24 16:58:33 +0100
committerMichael Adam <obnox@samba.org>2009-02-24 16:59:55 +0100
commitd7ca4997017e86b6f23ced64f1f1672bfb15716b (patch)
tree6cc3f9f5c6404b13c5c452dbafc7ee2832e6857e
parent6e16c5eed59bb3539af365d30e9ec35012b8c8ac (diff)
downloadsamba-d7ca4997017e86b6f23ced64f1f1672bfb15716b.tar.gz
samba-d7ca4997017e86b6f23ced64f1f1672bfb15716b.tar.bz2
samba-d7ca4997017e86b6f23ced64f1f1672bfb15716b.zip
s3:mount.cifs: make "mount.cifs -V" print the version, not usage.
Also make "mount.cifs -h" not exit with error exit code but with return code 0. Michael
-rw-r--r--source3/client/mount.cifs.c33
1 files changed, 28 insertions, 5 deletions
diff --git a/source3/client/mount.cifs.c b/source3/client/mount.cifs.c
index 641584947f..ae8a7fd186 100644
--- a/source3/client/mount.cifs.c
+++ b/source3/client/mount.cifs.c
@@ -1016,6 +1016,14 @@ uppercase_string(char *string)
return 1;
}
+static void print_cifs_mount_version(void)
+{
+ printf("mount.cifs version: %s.%s%s\n",
+ MOUNT_CIFS_VERSION_MAJOR,
+ MOUNT_CIFS_VERSION_MINOR,
+ MOUNT_CIFS_VENDOR_SUFFIX);
+}
+
int main(int argc, char ** argv)
{
int c;
@@ -1077,6 +1085,24 @@ int main(int argc, char ** argv)
exit(EX_SYSERR);
}
mountpoint = argv[2];
+ } else if (argc == 2) {
+ if ((strcmp(argv[1], "-V") == 0) ||
+ (strcmp(argv[1], "--version") == 0))
+ {
+ print_cifs_mount_version();
+ exit(0);
+ }
+
+ if ((strcmp(argv[1], "-h") == 0) ||
+ (strcmp(argv[1], "-?") == 0) ||
+ (strcmp(argv[1], "--help") == 0))
+ {
+ mount_cifs_usage();
+ exit(0);
+ }
+
+ mount_cifs_usage();
+ exit(EX_USAGE);
} else {
mount_cifs_usage();
exit(EX_USAGE);
@@ -1133,11 +1159,8 @@ int main(int argc, char ** argv)
case 'v':
++verboseflag;
break;
- case 'V':
- printf ("mount.cifs version: %s.%s%s\n",
- MOUNT_CIFS_VERSION_MAJOR,
- MOUNT_CIFS_VERSION_MINOR,
- MOUNT_CIFS_VENDOR_SUFFIX);
+ case 'V':
+ print_cifs_mount_version();
exit (0);
case 'w':
flags &= ~MS_RDONLY;