-/* $OpenBSD: main.c,v 1.66 2023/02/14 17:15:15 job Exp $ */
+/* $OpenBSD: main.c,v 1.67 2023/04/27 16:28:18 claudio Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
#define OP_PORT 1001
#define OP_RSYNCPATH 1002
#define OP_TIMEOUT 1003
-#define OP_VERSION 1004
#define OP_EXCLUDE 1005
#define OP_INCLUDE 1006
#define OP_EXCLUDE_FROM 1007
{ "no-times", no_argument, &opts.preserve_times, 0 },
{ "verbose", no_argument, &verbose, 1 },
{ "no-verbose", no_argument, &verbose, 0 },
- { "version", no_argument, NULL, OP_VERSION },
+ { "version", no_argument, NULL, 'V' },
{ NULL, 0, NULL, 0 }
};
opts.max_size = opts.min_size = -1;
- while ((c = getopt_long(argc, argv, "Dae:ghlnoprtvxz", lopts, &lidx))
+ while ((c = getopt_long(argc, argv, "aDe:ghlnoprtVvxz", lopts, &lidx))
!= -1) {
switch (c) {
case 'D':
case 'v':
verbose++;
break;
+ case 'V':
+ fprintf(stderr, "openrsync: protocol version %u\n",
+ RSYNC_PROTOCOL);
+ exit(0);
case 'x':
opts.one_file_system++;
break;
if (scan_scaled(optarg, &opts.min_size) == -1)
err(1, "bad min-size");
break;
- case OP_VERSION:
- fprintf(stderr, "openrsync: protocol version %u\n",
- RSYNC_PROTOCOL);
- exit(0);
case 'h':
default:
goto usage;
exit(rc);
usage:
fprintf(stderr, "usage: %s"
- " [-aDglnoprtvx] [-e program] [--address=sourceaddr]\n"
+ " [-aDglnoprtVvx] [-e program] [--address=sourceaddr]\n"
"\t[--contimeout=seconds] [--compare-dest=dir] [--del] [--exclude]\n"
"\t[--exclude-from=file] [--include] [--include-from=file]\n"
"\t[--no-motd] [--numeric-ids] [--port=portnumber]\n"
- "\t[--rsync-path=program] [--timeout=seconds] [--version]\n"
+ "\t[--rsync-path=program] [--timeout=seconds]\n"
"\tsource ... directory\n",
getprogname());
exit(ERR_SYNTAX);
-.\" $OpenBSD: rsync.1,v 1.30 2022/08/02 18:09:20 job Exp $
+.\" $OpenBSD: rsync.1,v 1.31 2023/04/27 16:28:18 claudio Exp $
.\"
.\" Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
.\"
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: August 2 2022 $
+.Dd $Mdocdate: April 27 2023 $
.Dt OPENRSYNC 1
.Os
.Sh NAME
.Nd synchronise local and remote files
.Sh SYNOPSIS
.Nm openrsync
-.Op Fl aDglnoprtvx
+.Op Fl aDglnoprtVvx
.Op Fl e Ar program
.Op Fl -address Ns = Ns Ar sourceaddr
.Op Fl -compare-dest Ns = Ns Ar directory
.Op Fl -port Ns = Ns Ar service
.Op Fl -rsync-path Ns = Ns Ar program
.Op Fl -timeout Ns = Ns Ar seconds
-.Op Fl -version
.Ar source ...
.Ar directory
.Sh DESCRIPTION
If this option is repeated, all mount point directories from the copy are
omitted.
Otherwise, it includes an empty directory at each mount point it encounters.
-.It Fl -version
+.It Fl V , -version
Print version and exit.
.El
.Pp