fedify lookup is becoming more capable in two different lookup modes:
In both cases, users often want to see results in the opposite order from the natural fetch order. For example, when inspecting a reply chain, one user may want root-to-leaf order, while another may want leaf-to-root order. Similarly, for traversed collection items, reverse output can be useful for quick chronological inspection depending on server ordering.
This issue proposes a --reverse option for fedify lookup that reverses output order. It should not change how references are resolved semantically; it should only affect presentation order of the final emitted objects/items.
--reverse should be compatible with both --traverse and --recurse.
Expected behavior by mode:
- With
--traverse, output traversed items in reverse order.
- With
--recurse, output the resolved chain in reverse order.
- Without either mode, if multiple input URLs/handles are given, reverse the output order of successfully fetched objects.
Implementation note: full reversal typically requires buffering the collected results before output. This can increase memory usage, so implementation should be explicit about buffering behavior and maintain predictable error handling.
Example invocations:
fedify lookup <collection-url> --traverse --reverse
fedify lookup <object-url> --recurse=replyTarget --reverse
fedify lookup <url1> <url2> <url3> --reverse
Acceptance criteria
--reverse is parsed and documented in lookup help.
--reverse works with --traverse and reverses emitted item order.
--reverse works with --recurse and reverses emitted chain order.
--reverse also affects multi-input default lookup output order.
- Error behavior remains consistent with existing mode semantics (
--suppress-errors, timeouts, fetch failures).
- Tests cover each mode with and without
--reverse.
fedify lookupis becoming more capable in two different lookup modes:--traversefor collection item traversal--recursefor recursive object-reference lookup (Add--recursetofedify lookupfor recursive object-reference lookup #606)In both cases, users often want to see results in the opposite order from the natural fetch order. For example, when inspecting a reply chain, one user may want root-to-leaf order, while another may want leaf-to-root order. Similarly, for traversed collection items, reverse output can be useful for quick chronological inspection depending on server ordering.
This issue proposes a
--reverseoption forfedify lookupthat reverses output order. It should not change how references are resolved semantically; it should only affect presentation order of the final emitted objects/items.--reverseshould be compatible with both--traverseand--recurse.Expected behavior by mode:
--traverse, output traversed items in reverse order.--recurse, output the resolved chain in reverse order.Implementation note: full reversal typically requires buffering the collected results before output. This can increase memory usage, so implementation should be explicit about buffering behavior and maintain predictable error handling.
Example invocations:
fedify lookup <collection-url> --traverse --reversefedify lookup <object-url> --recurse=replyTarget --reversefedify lookup <url1> <url2> <url3> --reverseAcceptance criteria
--reverseis parsed and documented inlookuphelp.--reverseworks with--traverseand reverses emitted item order.--reverseworks with--recurseand reverses emitted chain order.--reversealso affects multi-input default lookup output order.--suppress-errors, timeouts, fetch failures).--reverse.