diff options
author | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2021-03-25 20:00:42 +0100 |
---|---|---|
committer | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2021-03-25 20:00:50 +0100 |
commit | fea348c7b4cf3b39510b6707320c2afce2ca7835 (patch) | |
tree | c6fb2b5185f90dfcd01612a531e4c3bc243cb137 | |
parent | b1eb9ffd97827b46cdd904763796758c2e091834 (diff) |
Use "*" as the default search query.
-rw-r--r-- | CHANGELOG.rst | 5 | ||||
-rw-r--r-- | docs/source/man/lesana-search.rst | 7 | ||||
-rw-r--r-- | lesana/command.py | 6 |
3 files changed, 16 insertions, 2 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c8a2e41..7b3dc6f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -13,6 +13,11 @@ Unreleased add it to existing repositories by running ``lesana init`` on them (this is safe to do and won't change your settings or your data). * New command: get-values to get a list of values for a field. #6 +* lesana-search now defaults to a query of ``'*'``. + + This means that ``lesana search --all`` is now enough to list all + entries, while ``lesana search`` with no other options will list the + first 12 entries (possibly according to a default sorting setting). 0.8.1 ===== diff --git a/docs/source/man/lesana-search.rst b/docs/source/man/lesana-search.rst index 0f2861c..fff4b8e 100644 --- a/docs/source/man/lesana-search.rst +++ b/docs/source/man/lesana-search.rst @@ -7,7 +7,7 @@ SYNOPSIS lesana search [--help] [--collection COLLECTION] [--template TEMPLATE] \ [--offset OFFSET] [--pagesize PAGESIZE] [--all] \ - [--sort FIELD1 [--sort FIELD2 ...]] query [query ...] + [--sort FIELD1 [--sort FIELD2 ...]] [query [query ...]] DESCRIPTION =========== @@ -25,6 +25,11 @@ By default entries are printed according to the ``entry_label`` from the ``settings.yaml`` file, but they can be rendered according to a jinja2 template. +If no query is specified, it will default to ``'*'``, i.e. search all +entries: thus ``lesana search --all`` will print all entries, while just +``lesana search`` will print the first 12 entries, possibly according to +the relevant sorting options. + OPTIONS ======= diff --git a/lesana/command.py b/lesana/command.py index 9ff3533..62c8020 100644 --- a/lesana/command.py +++ b/lesana/command.py @@ -274,7 +274,11 @@ class Search(Command): ), ( ['query'], - dict(help='Xapian query to search in the collection', nargs='+'), + { + 'help': 'Xapian query to search in the collection', + 'nargs': '*', + 'default': '*', + }, ), ] |