//! What a listing owes its reader about the rows it did not print. //! //! Every listing in this tree cuts its answer twice and for two unrelated //! reasons: `--limit` cuts a listing that was read whole, and the page cap //! cuts the read itself. One is the caller's own doing, one is the tool //! running out of budget, and they want different words — which is why //! [`cuts`] says both rather than picking. //! //! It lives here rather than in [`crate::clients::atproto::pds`] because it //! is presentation: the walk knows what it read, and only a command knows //! what it printed. The evidence half of the question is //! [`crate::clients::atproto::pds::Evidence`], which travels with the records. use crate::clients::atproto::pds::Evidence; /// Say what a listing left out, in both of the ways it can happen. /// /// `total` is how many rows survived every filter; `shown` is how many were /// printed. `what` names the records for the truncation warning — "your pull /// records", "issue records", "@alice's repo records" — and is the only part /// a caller chooses. /// /// Three commands had three versions of this and one had none: `repo list` /// said both sentences, `pr list` and `issue list` warned about the page cap /// and said nothing at all about `--limit`, and every one of them named /// [`crate::clients::atproto::pds::MAX_PAGES`] literally in the warning — /// a number that stopped being the budget in force the day a listing could /// ask to read a whole collection. pub(in crate::cmd) fn cuts(evidence: Evidence, total: usize, shown: usize, what: &str) { if total > shown { crate::term::say::note!(Pds, "{} more; raise --limit to see them", total - shown); } if evidence.truncated { crate::term::say::warning!( Pds, "stopped after {} pages of {what}; older ones may be missing", evidence.reach.pages() ); } }