From e98aed87f0ead47b73c38cc4ca345f27ba600c49 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 12 Jan 2022 13:56:32 +0100 Subject: [PATCH] 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). --- src/config.c | 8 ++++++-- src/main.c | 4 ++-- src/mbsync.1 | 7 ++++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/config.c b/src/config.c index b3a43e9..9cef416 100644 --- a/src/config.c +++ b/src/config.c @@ -205,6 +205,8 @@ getopt_helper( conffile_t *cfile, int *cops, channel_conf_t *conf ) *cops |= OP_GONE; } else if (!strcasecmp( "Flags", arg )) { *cops |= OP_FLAGS; + } else if (!strcasecmp( "All", arg ) || !strcasecmp( "Full", arg )) { + *cops |= OP_MASK_TYPE; } else if (!strcasecmp( "PullUpgrade", arg )) { conf->ops[N] |= OP_UPGRADE; } 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; } else if (!strcasecmp( "PullFlags", arg )) { conf->ops[N] |= OP_FLAGS; + } else if (!strcasecmp( "PullFull", arg )) { + conf->ops[N] |= OP_MASK_TYPE; } else if (!strcasecmp( "PushUpgrade", arg )) { conf->ops[F] |= OP_UPGRADE; } 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; } else if (!strcasecmp( "PushFlags", arg )) { conf->ops[F] |= OP_FLAGS; - } else if (!strcasecmp( "All", arg ) || !strcasecmp( "Full", arg )) { - *cops |= XOP_PULL|XOP_PUSH; + } else if (!strcasecmp( "PushFull", arg )) { + conf->ops[F] |= OP_MASK_TYPE; } else if (!strcasecmp( "None", arg ) || !strcasecmp( "Noop", arg )) { conf->ops[F] |= XOP_TYPE_NOOP; } else { diff --git a/src/main.c b/src/main.c index 45dc0f7..55eed80 100644 --- a/src/main.c +++ b/src/main.c @@ -250,8 +250,6 @@ main( int argc, char **argv ) mvars->ops[F] |= XOP_CREATE_NOOP | XOP_HAVE_CREATE; } else if (!strcmp( opt, "no-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" )) { mvars->ops[F] |= XOP_TYPE_NOOP | XOP_HAVE_TYPE; } else if (starts_with( opt, -1, "pull", 4 )) { @@ -286,6 +284,8 @@ main( int argc, char **argv ) op |= OP_GONE; } else if (!strcmp( opt, "flags" )) { op |= OP_FLAGS; + } else if (!strcmp( opt, "full" )) { + op |= OP_MASK_TYPE; } else { badopt: error( "Unknown option '%s'\n", argv[oind - 1] ); diff --git a/src/mbsync.1 b/src/mbsync.1 index 912f2d4..c13496b 100644 --- a/src/mbsync.1 +++ b/src/mbsync.1 @@ -574,7 +574,7 @@ case you need to enable this option. (Global default: \fBno\fR). . .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: .br \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 maildir_trash option. .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. .br \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 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. -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 new messages and flag changes from the far side to the near side, "\fBSync\fR\ \fBNew\fR\ \fBGone\fR" will propagate message arrivals and