Skip to content

feat(command): Add bare group help Json output support - #78

Open
mguerrero3-godaddy wants to merge 3 commits into
mainfrom
feat/help-json-output
Open

feat(command): Add bare group help Json output support#78
mguerrero3-godaddy wants to merge 3 commits into
mainfrom
feat/help-json-output

Conversation

@mguerrero3-godaddy

Copy link
Copy Markdown
Collaborator

Summary

  • Reimplements feat(command): Add BareGroupAction support #76 based on several ideas shared on that PR. Simpler, no bare group actions to define by consumers on each command, but a default general behavior reusing thetree --json command scoping to the location of that group command.

NOTE: This isn't implementing the --help --json approach, this just ensures that bare group commands now expose their subcommand tree as structured, machine-readable discovery output by default, instead of silently falling back to human-oriented clap help text that a script or agent can't parse. The discussion to implement --help --json is opened as an idea from @jpage-godaddy and can be implemented here or in a separate PR.

Test plan

  • cargo fmt --all --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test --all-targets

Manual verification

Setup:

# In the cli repo, temporarily override the engine dependency:
cd cli/rust
# Edit Cargo.toml → cli-engine = { features = ["pkce-auth"], path = "../../cli-engine" }
cargo build --release && cp target/release/gddy ~/.local/bin/gddy

Test WITHOUT the fix (baseline):

cd cli-engine && git checkout main
cd cli/rust && cargo build --release && cp target/release/gddy ~/.local/bin/gddy
# <command to reproduce the issue>
# Expected: <describe broken behavior>

Test WITH the fix:

cd cli-engine && git checkout <this-branch>
cd cli/rust && cargo build --release && cp target/release/gddy ~/.local/bin/gddy
# <same command>
# Expected: <describe fixed behavior>

Cleanup:

# Revert cli/rust/Cargo.toml back to:
# cli-engine = { features = ["pkce-auth"], version = "<published-version>" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant