Merge pull request #4332 from arbanhossain/master

Add --exclude flag
This commit is contained in:
Adrian Sampson 2022-04-19 09:19:52 -04:00 committed by GitHub
commit 7c670711ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View file

@ -1128,6 +1128,11 @@ def _load_plugins(options, config):
else:
plugin_list = config['plugins'].as_str_seq()
# Exclude any plugins that were specified on the command line
if options.exclude is not None:
plugin_list = [p for p in plugin_list
if p not in options.exclude.split(',')]
plugins.load_plugins(plugin_list)
return plugins
@ -1261,6 +1266,8 @@ def _raw_main(args, lib=None):
help='path to configuration file')
parser.add_option('-p', '--plugins', dest='plugins',
help='a comma-separated list of plugins to load')
parser.add_option('-P', '--disable-plugins', dest='exclude',
help='a comma-separated list of plugins to disable')
parser.add_option('-h', '--help', dest='help', action='store_true',
help='show this help message and exit')
parser.add_option('--version', dest='version', action='store_true',

View file

@ -20,6 +20,8 @@ New features:
* :doc:`/plugins/convert`: Add a new `auto_keep` option that automatically
converts files but keeps the *originals* in the library.
:bug:`1840` :bug:`4302`
* Added a ``-P`` (or ``--disable-plugins``) flag to specify one/multiple plugin(s) to be
disabled at startup.
Bug fixes:

View file

@ -445,6 +445,9 @@ import ...``.
specified, the plugin list in your configuration is ignored. The long form
of this argument also allows specifying no plugins, effectively disabling
all plugins: ``--plugins=``.
* ``-P plugins``: specify a comma-separated list of plugins to disable in a
specific beets run. This will overwrite ``-p`` if used with it. To disable all plugins, use
``--plugins=`` instead.
Beets also uses the ``BEETSDIR`` environment variable to look for
configuration and data.