Skip to content

Commit

Permalink
Further document formatted modify with examples
Browse files Browse the repository at this point in the history
I think these can make it clearer why someone would want to use this
feature. (Part of beetbox#4095.)
  • Loading branch information
sampsyo committed Aug 20, 2022
1 parent dad918e commit b207224
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ Major new features:
Thanks to :user:`edgars-supe`.
* The :ref:`modify-cmd` and :ref:`import-cmd` can now use
:doc:`/reference/pathformat` formats when setting fields.
For example, you can now do ``beet modify title='$track $title'`` to put
track numbers into songs' titles.
:bug:`488`

Other new things:
Expand Down
6 changes: 5 additions & 1 deletion docs/reference/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,12 @@ artist="Tom Tom Club"`` will change the artist for the track "Genius of Love."
To remove fields (which is only possible for flexible attributes), follow a
field name with an exclamation point: ``field!``.

Values support the same template syntax as beets'
Values can also be *templates*, using the same syntax as
:doc:`path formats <pathformat>`.
For example, ``beet modify artist='$artist_sort'`` will copy the artist sort
name into the artist field for all your tracks,
and ``beet modify title='$track $title'`` will add track numbers to their
title metadata.

The ``-a`` switch also operates on albums in addition to the individual tracks.
Without this flag, the command will only change *track-level* data, even if all
Expand Down

0 comments on commit b207224

Please sign in to comment.