diff --git a/docs/reference/cli.rst b/docs/reference/cli.rst index 4ff0346a6..317dbd00d 100644 --- a/docs/reference/cli.rst +++ b/docs/reference/cli.rst @@ -169,8 +169,9 @@ list Want to search for "Gronlandic Edit" by of Montreal? Try ``beet list gronlandic``. Maybe you want to see everything released in 2009 with -"vegetables" in the title? Try ``beet list year:2009 title:vegetables``. (Read -more in :doc:`query`.) +"vegetables" in the title? Try ``beet list year:2009 title:vegetables``. You +can also specify the order used when outputting the results (Read more in +:doc:`query`.) You can use the ``-a`` switch to search for albums instead of individual items. In this case, the queries you use are restricted to album-level fields: for diff --git a/docs/reference/query.rst b/docs/reference/query.rst index cf981bed2..a224c8dc9 100644 --- a/docs/reference/query.rst +++ b/docs/reference/query.rst @@ -183,3 +183,25 @@ equivalent:: Note that this only matches items that are *already in your library*, so a path query won't necessarily find *all* the audio files in a directory---just the ones you've already added to your beets library. + + +Sort Order +---------- + +You can also specify the order used when outputting the results. Of course, this +is only useful when displaying the result, for example with the ``list`` +command, and is useless when the query is used as a filter for an command. Use +the name of the `field` you want to sort on, followed by a ``+`` or ``-`` sign +if you want ascending or descending sort. For example this command:: + + $ beet list -a year+ + +will list all albums in chronological order. + +You can also specify several sort orders, which will be used in the same order at +which they appear in your query:: + + $ beet list -a genre+ year+ + +This command will sort all albums by genre and, in each genre, in chronological +order.