diff --git a/cmirror.c b/cmirror.c index b1711ec..126a281 100644 --- a/cmirror.c +++ b/cmirror.c @@ -26,6 +26,8 @@ #include #include +#define CMIRROR_VERSION "v1.7" + // http://owww.molgen.mpg.de/~buczek/glib-doc/ #include @@ -570,6 +572,7 @@ static void usage(char *argv0) { fprintf(stderr, "usage: %s [options] path [node:]path\n" " %s --slave [--local-slave] [--socket-name path] [options] path\n" + " %s --version\n" "\n" " options:\n" " --noop dont change anything\n" @@ -594,7 +597,7 @@ static void usage(char *argv0) { " --socket-name PATH EXPERIMENTAL use PATH as name for AF unix sockets\n" " --noatime don't touch atime on sender\n" " --ignore-permissions do not attempt to change file permissions\n", - argv0, argv0); + argv0, argv0, argv0); _exit(1); } @@ -624,6 +627,7 @@ static struct option options[] = { { "socket-name", 1, NULL, 104 }, { "noatime", 0, &noatime, 1 }, { "ignore-permissions", 0, &ignore_permissions, 1 }, + { "version", 0, NULL, 105 }, { NULL } }; @@ -865,7 +869,7 @@ static void slave(char *slave_path) { fileop_chmod(fi_want->perm, filename); } } else if (fi_want->type== 'S') { - warn("%s: is a socket(ignored)\n", filename); + ; // silently ignore sockets } else if (fi_want->type == 'C' || fi_want->type == 'B') { if (!fi_is || fi_is->type != fi_want->type || fi_is->rdev != fi_want->rdev) { if (fi_is) @@ -1478,7 +1482,10 @@ int main(int argc, char **argv) { g_strv_builder_add(ssh_opts_builder, optarg); else if (opt == 104) unix_socket_name = g_strdup(optarg); - else if (opt == '?') + else if (opt == 105) { + printf("cmirror version " CMIRROR_VERSION "\n"); + exit(0); + } else if (opt == '?') usage(argv0); else die("internal error: getopt returned %d\n", opt);