wagtail / wagtail/wagtail-cli

`docs search` with --json option

Open
#5 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
5
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Problem statement

Not sure if this is an issue, but I found it slightly confusing that there are two --json options that can be set when using docs search

Specifying the top level --json/--human flag is ignored by the docs search commands (but fails if you specify both).

Only the search --json option is respected.

wt --json docs search --json query

Proposed solution

I guess the docs say that the global options only apply on wt api:

https://github.com/wagtail/wagtail-cli/blob/190d1bee2dad91f79336c3efe68ddbab7f14989d/docs/usage.md?plain=1#L15-L27

But it would be possible to pass the json option through to the docs search command?

Alternative solutions

No response

Additional context

No response

Working on this

Contribute to the discussion to help this move forward. Explain your use cases, discuss possible solutions, research how to adapt existing code, or compatibility concerns.

Once others agree with the proposed changes, anyone can contribute to this. View our contributing guidelines. Add a comment to the issue to explain what approach you are taking.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading docs/usage.md around the global options and running wt --json docs search --json query to reproduce the behavior. Trace how the global and search-specific JSON options are parsed for docs search, then confirm that the intended option is accepted consistently without the current conflict.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.