This commit is contained in:
dan soucy 2017-06-01 16:28:40 +00:00 committed by GitHub
commit 4007caf96a
2 changed files with 14 additions and 0 deletions

View File

@ -85,6 +85,14 @@ Allows one to specify a particular account or set of accounts to sync without
having to edit the config file.
-A <account1[,account2[,...]]>::
Skips the listed accounts, even if they are in the config file.
+
Allows one to specify a particular account or set of accounts to skip sync
without having to edit the config file.
-c <path/to/configuration_file>::
Specifies a configuration file to use.

View File

@ -134,6 +134,10 @@ class OfflineImap(object):
metavar="account1[,account2[,...]]",
help="list of accounts to sync")
parser.add_option("-A", dest="skipaccounts",
metavar="account1[,account2[,...]]",
help="list of accounts to skip")
parser.add_option("-c", dest="configfile", metavar="FILE",
default=None,
help="specifies a configuration file to use")
@ -399,6 +403,8 @@ class OfflineImap(object):
if options.accounts:
activeaccountnames = options.accounts
activeaccountnames = [x.lstrip() for x in activeaccountnames.split(",")]
if options.skipaccounts:
activeaccountnames = [x for x in activeaccountnames if x not in options.skipaccounts]
allaccounts = accounts.getaccountlist(self.config)
for accountname in activeaccountnames: