You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ability to add custom options/flags to existing CLI commands
Hi,
I've written a small plugin that sets the genre of albums I import into beets to To Listen. This works fine, but I would like to add an --import-genre option to the import command so that my plugin will not apply the To Listen genre in case that flag is passed on the CLI.
I've browsed the source code and I think:
Adding an option to a currently existing command is not possible using plugins
Such a plugin won't be able to see the (extra) options passed to the import command
I can imagine (but have not verified) problem 2 can be circumvented by modifying the config object so that the plugin can access the setting that way, is that kind of right?
I would appreciate if someone could tell me whether I'm assessing my specific situation (more or less) the right way, and I think being able to extend the default commands is a feature request that adds power to beets.
Thanks!
The text was updated successfully, but these errors were encountered:
Hi! The idea to add arbitrary command-line options to built-in beets commands has come up before, so it's worth considering—but it's deceptively complicated, and it (probably inevitably) ties us to a specific CLI parsing library.
For this particular case, though, have you seen #1881? The idea is to add a flag that lets you set any field to any value on import, including genre or even a special to_listen field that you invent.
sampsyo
added
the
needinfo
We need more details or follow-up from the filer before this can be tagged "bug" or "feature."
label
May 18, 2017
#1881 sounds fine for my purpose indeed! I'll wait for that feature to get finished :).
As far as my feature request is concerned: I might look into it. I have been wanting to make my programming contribution debut for quite some time. If I do decide to pick it up I'll certainly discuss my ideas and plans here. Obviously I'll be reading the wiki first.
Ability to add custom options/flags to existing CLI commands
Hi,
I've written a small plugin that sets the genre of albums I import into beets to To Listen. This works fine, but I would like to add an
--import-genre
option to theimport
command so that my plugin will not apply the To Listen genre in case that flag is passed on the CLI.I've browsed the source code and I think:
import
commandI can imagine (but have not verified) problem 2 can be circumvented by modifying the
config
object so that the plugin can access the setting that way, is that kind of right?I would appreciate if someone could tell me whether I'm assessing my specific situation (more or less) the right way, and I think being able to extend the default commands is a feature request that adds power to beets.
Thanks!
The text was updated successfully, but these errors were encountered: