silently reinterpret --full

change it from --{push,pull} to --{new,gone,flags,upgrade}.
that alone doesn't change anything; combining it with any other option
would cause a complaint anyway.

this enables us to introduce --{push,pull}-full, which will matter when
--full doesn't actually include all type flags any more, as we'll then
be able to combine it with the extra type flag(s). in the same vein, we
now advertize "Sync Full" instead of "Sync All" (both continue to be
recognized).
This commit is contained in:
Oswald Buddenhagen 2022-01-12 13:56:32 +01:00
parent 58564e4f76
commit e98aed87f0
3 changed files with 12 additions and 7 deletions

View File

@ -205,6 +205,8 @@ getopt_helper( conffile_t *cfile, int *cops, channel_conf_t *conf )
*cops |= OP_GONE; *cops |= OP_GONE;
} else if (!strcasecmp( "Flags", arg )) { } else if (!strcasecmp( "Flags", arg )) {
*cops |= OP_FLAGS; *cops |= OP_FLAGS;
} else if (!strcasecmp( "All", arg ) || !strcasecmp( "Full", arg )) {
*cops |= OP_MASK_TYPE;
} else if (!strcasecmp( "PullUpgrade", arg )) { } else if (!strcasecmp( "PullUpgrade", arg )) {
conf->ops[N] |= OP_UPGRADE; conf->ops[N] |= OP_UPGRADE;
} else if (!strcasecmp( "PullReNew", arg )) { } else if (!strcasecmp( "PullReNew", arg )) {
@ -219,6 +221,8 @@ getopt_helper( conffile_t *cfile, int *cops, channel_conf_t *conf )
conf->ops[N] |= OP_GONE; conf->ops[N] |= OP_GONE;
} else if (!strcasecmp( "PullFlags", arg )) { } else if (!strcasecmp( "PullFlags", arg )) {
conf->ops[N] |= OP_FLAGS; conf->ops[N] |= OP_FLAGS;
} else if (!strcasecmp( "PullFull", arg )) {
conf->ops[N] |= OP_MASK_TYPE;
} else if (!strcasecmp( "PushUpgrade", arg )) { } else if (!strcasecmp( "PushUpgrade", arg )) {
conf->ops[F] |= OP_UPGRADE; conf->ops[F] |= OP_UPGRADE;
} else if (!strcasecmp( "PushReNew", arg )) { } else if (!strcasecmp( "PushReNew", arg )) {
@ -233,8 +237,8 @@ getopt_helper( conffile_t *cfile, int *cops, channel_conf_t *conf )
conf->ops[F] |= OP_GONE; conf->ops[F] |= OP_GONE;
} else if (!strcasecmp( "PushFlags", arg )) { } else if (!strcasecmp( "PushFlags", arg )) {
conf->ops[F] |= OP_FLAGS; conf->ops[F] |= OP_FLAGS;
} else if (!strcasecmp( "All", arg ) || !strcasecmp( "Full", arg )) { } else if (!strcasecmp( "PushFull", arg )) {
*cops |= XOP_PULL|XOP_PUSH; conf->ops[F] |= OP_MASK_TYPE;
} else if (!strcasecmp( "None", arg ) || !strcasecmp( "Noop", arg )) { } else if (!strcasecmp( "None", arg ) || !strcasecmp( "Noop", arg )) {
conf->ops[F] |= XOP_TYPE_NOOP; conf->ops[F] |= XOP_TYPE_NOOP;
} else { } else {

View File

@ -250,8 +250,6 @@ main( int argc, char **argv )
mvars->ops[F] |= XOP_CREATE_NOOP | XOP_HAVE_CREATE; mvars->ops[F] |= XOP_CREATE_NOOP | XOP_HAVE_CREATE;
} else if (!strcmp( opt, "no-remove" )) { } else if (!strcmp( opt, "no-remove" )) {
mvars->ops[F] |= XOP_REMOVE_NOOP | XOP_HAVE_REMOVE; mvars->ops[F] |= XOP_REMOVE_NOOP | XOP_HAVE_REMOVE;
} else if (!strcmp( opt, "full" )) {
mvars->ops[F] |= XOP_HAVE_TYPE | XOP_PULL | XOP_PUSH;
} else if (!strcmp( opt, "noop" )) { } else if (!strcmp( opt, "noop" )) {
mvars->ops[F] |= XOP_TYPE_NOOP | XOP_HAVE_TYPE; mvars->ops[F] |= XOP_TYPE_NOOP | XOP_HAVE_TYPE;
} else if (starts_with( opt, -1, "pull", 4 )) { } else if (starts_with( opt, -1, "pull", 4 )) {
@ -286,6 +284,8 @@ main( int argc, char **argv )
op |= OP_GONE; op |= OP_GONE;
} else if (!strcmp( opt, "flags" )) { } else if (!strcmp( opt, "flags" )) {
op |= OP_FLAGS; op |= OP_FLAGS;
} else if (!strcmp( opt, "full" )) {
op |= OP_MASK_TYPE;
} else { } else {
badopt: badopt:
error( "Unknown option '%s'\n", argv[oind - 1] ); error( "Unknown option '%s'\n", argv[oind - 1] );

View File

@ -574,7 +574,7 @@ case you need to enable this option.
(Global default: \fBno\fR). (Global default: \fBno\fR).
. .
.TP .TP
\fBSync\fR {\fBNone\fR|[\fBPull\fR] [\fBPush\fR] [\fBNew\fR] [\fBUpgrade\fR] [\fBGone\fR] [\fBFlags\fR]|\fBAll\fR} \fBSync\fR {\fBNone\fR|[\fBPull\fR] [\fBPush\fR] [\fBNew\fR] [\fBUpgrade\fR] [\fBGone\fR] [\fBFlags\fR] [\fBFull\fR]}
Select the synchronization operation(s) to perform: Select the synchronization operation(s) to perform:
.br .br
\fBPull\fR - propagate changes from far to near side. \fBPull\fR - propagate changes from far to near side.
@ -595,7 +595,7 @@ that Store is expunged.
well; this is particularly interesting if you use \fBmutt\fR with the well; this is particularly interesting if you use \fBmutt\fR with the
maildir_trash option. maildir_trash option.
.br .br
\fBAll\fR (\fB--full\fR on the command line) - all of the above. \fBFull\fR - alias for "\fBNew\fR\ \fBUpgrade\fR\ \fBGone\fR\ \fBFlags\fR".
This is the global default. This is the global default.
.br .br
\fBNone\fR (\fB--noop\fR on the command line) - don't propagate anything. \fBNone\fR (\fB--noop\fR on the command line) - don't propagate anything.
@ -608,7 +608,8 @@ perform. There are two styles of asserting the cells:
.br .br
In the first style, the flags select entire rows/colums in the matrix. Only In the first style, the flags select entire rows/colums in the matrix. Only
the cells which are selected both horizontally and vertically are asserted. the cells which are selected both horizontally and vertically are asserted.
Specifying no flags from a class is like specifying all flags from this class. Specifying no direction is like specifying both directions, and specifying
no type is like specifying \fBFull\fR.
For example, "\fBSync\fR\ \fBPull\fR\ \fBNew\fR\ \fBFlags\fR" will propagate For example, "\fBSync\fR\ \fBPull\fR\ \fBNew\fR\ \fBFlags\fR" will propagate
new messages and flag changes from the far side to the near side, new messages and flag changes from the far side to the near side,
"\fBSync\fR\ \fBNew\fR\ \fBGone\fR" will propagate message arrivals and "\fBSync\fR\ \fBNew\fR\ \fBGone\fR" will propagate message arrivals and