Compare commits
2 commits
e576ce1278
...
5c564d21b0
| Author | SHA1 | Date | |
|---|---|---|---|
| 5c564d21b0 | |||
| c2f42e8557 |
1 changed files with 17 additions and 4 deletions
|
|
@ -1,6 +1,6 @@
|
|||
from beets import ui
|
||||
from beets.ui import Subcommand, print_
|
||||
from beets.ui.commands import print_and_modify
|
||||
from beets.ui.commands.modify import print_and_modify
|
||||
from beets.dbcore import FieldQuery
|
||||
from beets.dbcore.query import SlowFieldSort
|
||||
|
||||
|
|
@ -68,8 +68,7 @@ def modify_labels(lib, opts, args):
|
|||
action = args[0]
|
||||
|
||||
if action not in action_map:
|
||||
print_("%s is not a valid action. " % action)
|
||||
print_("Valid actions are: add, remove, removeall, show, transfer, edit")
|
||||
print_("%s is not a valid action. Run 'beet labels --help' for usage." % action)
|
||||
return
|
||||
|
||||
actnum = action_map[action]
|
||||
|
|
@ -297,7 +296,21 @@ def edit_labels(lib, opts, args):
|
|||
|
||||
print_(f"Updated {len(changes)} item(s).")
|
||||
|
||||
labels_command = Subcommand('labels', help='Add or remove labels')
|
||||
labels_command = Subcommand(
|
||||
'labels',
|
||||
help='Add, remove, or inspect labels on library items',
|
||||
usage='%prog labels <action> [args] [query]',
|
||||
)
|
||||
labels_command.parser.usage = """%prog labels <action> [args] [query]
|
||||
|
||||
Actions:
|
||||
add <label>[:<cost>] [query] Add a label (optionally with a cost value)
|
||||
remove <label> [query] Remove a label from items
|
||||
removeall [query] Remove all labels from items
|
||||
show [query] Display labels on items
|
||||
transfer <src-query> <dst-query>
|
||||
Copy labels from one item to another
|
||||
edit [query] Open items' labels in a text editor"""
|
||||
labels_command.func = modify_labels
|
||||
|
||||
class HasLabelQuery(FieldQuery):
|
||||
|
|
|
|||
Loading…
Reference in a new issue