Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ To be released.

### @fedify/cli

- Added `--reverse` option to `fedify lookup` to reverse presentation order
of emitted results. It now works across default multi-input lookup,
`--traverse` collection traversal output, and `--recurse` object chains,
while preserving existing fetch/error semantics. [[#607], [#609]]

- Fixed `fedify lookup` printing separators with extra quotes between
adjacent objects/items in some output paths (e.g., recurse/traverse
flows). Separators are now printed as plain text consistently.
Expand All @@ -42,7 +47,9 @@ To be released.
[[#608]]

[#606]: https://github.com/fedify-dev/fedify/issues/606
[#607]: https://github.com/fedify-dev/fedify/issues/607
[#608]: https://github.com/fedify-dev/fedify/pull/608
[#609]: https://github.com/fedify-dev/fedify/pull/609

### @fedify/vocab

Expand Down
17 changes: 17 additions & 0 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ firstKnock = "draft-cavage-http-signatures-12" # or "rfc9421"
allowPrivateAddress = false
traverse = false
suppressErrors = false
reverse = false
defaultFormat = "default" # "default", "raw", "compact", or "expand"
separator = "----"
timeout = 30 # seconds
Expand Down Expand Up @@ -1021,6 +1022,22 @@ It does not affect the output when looking up a single object.
> The separator is also used when looking up a collection object with the
> [`-t`/`--traverse`](#t-traverse-traverse-the-collection) option.

### `--reverse`: Reverse output order

*This option is available since Fedify 2.1.0.*

The `--reverse` option reverses the output order of fetched results.
It affects output order only, and does not change lookup semantics.

~~~~ sh
fedify lookup @fedify@hollo.social @hongminhee@fosstodon.org --reverse
fedify lookup --traverse https://fosstodon.org/users/hongminhee/outbox --reverse
fedify lookup --recurse=replyTarget https://hollo.social/@fedify/019c8522-b247-79d3-b0e7-c6a2293bb1cf --reverse
~~~~

When using `--reverse`, `fedify lookup` buffers results before printing.
This may increase memory usage for large traversals or long recursion chains.

### `-o`/`--output`: Output file path

*This option is available since Fedify 1.8.0.*
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const lookupSchema = pipe(
),
recurseDepth: optional(pipe(number(), integer(), minValue(1))),
suppressErrors: optional(boolean()),
reverse: optional(boolean()),
defaultFormat: optional(picklist(["default", "raw", "compact", "expand"])),
separator: optional(string()),
timeout: optional(number()),
Expand Down
Loading
Loading