Re: Meaning of offset in notmuch search --output=files --offset=

Subject: Re: Meaning of offset in notmuch search --output=files --offset=

Date: Sat, 25 May 2024 10:07:36 +0300

To: notmuch@notmuchmail.org

Cc:

From: Teemu Likonen


* 2024-05-20 21:24:01+0300, Teemu Likonen wrote:

> It doesn't seem clear how offset is counted on command like
>
>     notmuch search --output=files --offset=10 ...
>
> Does it skip 10 output files (which may belong to less than 10 messages)
> or does it skip 10 messages (so it possibly skips more than 10 files)?
> Manual page speaks of "results" but I think it can be interpreted either
> as "displayed output results" or "search match results (messages)".

I tested and the answer is: --offset option skips that many search match
messages. So it looks to me that command

    notmuch search --output=files --offset=10 ...

internally lists all matched messages, skips to the offset, and then
starts printing the file names of the rest of the message list.

> Perhaps the manual page needs a few more words to make it clear.

    --offset=[-]N
            Skip displaying the first N results. With the leading '-',
            start at the Nth result from the end.

What if we change the first sentence to "Skip displaying the first N
search results"?

-- 
/// Teemu Likonen - .-.. https://www.iki.fi/tlikonen/
// OpenPGP: 6965F03973F0D4CA22B9410F0F2CAE0E07608462
signature.asc (application/pgp-signature)
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: