Skip to content

[codex] Add relation metadata and hidden help fields - #36

Merged
gen740 merged 6 commits into
mainfrom
codex/metadata-relations-hidden-deprecated
May 12, 2026
Merged

gen740 merged 6 commits into
mainfrom
codex/metadata-relations-hidden-deprecated

Conversation

@gen740

@gen740 gen740 commented May 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add relation metadata APIs: together, conflicts, and depends_on
  • validate relations at parse time and render them in generated help
  • add hidden/deprecated metadata plus default/env/required help rendering
  • split argument base tags and validation helpers into dedicated headers

Validation

  • nix run .#build
  • ctest --test-dir build --output-on-failure

gen740 added 5 commits May 12, 2026 13:05
Rename the color mode to avoid the underscore suffix and enable color
detection for help output during error finalization.

BREAKING CHANGE: ColorMode::auto_ is renamed to ColorMode::detect.
Use the ansi_up library to parse and render ANSI escape sequences
in the ExamplePlayground component output.
@gen740
gen740 marked this pull request as ready for review May 12, 2026 06:24
@gen740
gen740 requested a review from Copilot May 12, 2026 06:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the CLI20 schema/help system with first-class “relation” metadata (groups, conflicts, depends_on), adds hidden/deprecated/default/env/required metadata rendering in generated help, and refactors argument base tags + compile-time validation into dedicated headers.

Changes:

  • Add cli::relations(...) API with group, conflicts, and depends_on, including compile-time schema checks and parse-time validation.
  • Enhance help generation with hidden/deprecated fields and inline metadata (required/env/default + relation hints), plus a customizable ANSI palette.
  • Add docs + examples for relations and update the docs playground to render ANSI output.

Reviewed changes

Copilot reviewed 25 out of 26 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/test_parse.cc Adds relation schema fixtures + parse-time validation tests.
tests/test_help.cc Updates color/help expectations; adds tests for hidden/deprecated/metadata + relations rendering.
include/cli/relation.hh Introduces relation model types and builder functions (group/conflicts/depends_on/relations).
include/cli/parser.hh Validates relations after required/env handling; extends format_help to accept a palette.
include/cli/help.hh Renders hidden/deprecated/default/env/required and relation metadata; adds “Option groups” section; palette-aware styling.
include/cli/color.hh Renames color mode to detect and adds HelpPalette + palette-aware resolve_color.
include/cli/argument.hh Adds hidden/deprecated fields to parameters; wires relation validation into ArgumentSpec; refactors includes.
include/cli/argument_validation.hh New header for compile-time validation helpers, including relation well-formedness checks.
include/cli/argument_base.hh New header containing tag base classes + Nargs/Presence primitives.
flake.nix Updates docs npm dependency hash.
examples/relations.cc Adds a runnable example demonstrating relations.
docs/src/components/ExamplePlayground.tsx Renders ANSI output as HTML via ansi_up for docs playground output.
docs/sidebars.ts Adds the new Relations doc page to the sidebar.
docs/package.json Adds ansi_up dependency.
docs/package-lock.json Locks ansi_up dependency.
docs/docs/relations.mdx New documentation page describing relations API and behavior.
docs/docs/examples/relations.mdx New example doc page for the relations example.
docs/docs/examples/index.mdx Inserts Relations into the examples index and renumbers subsequent entries.
docs/docs/examples/git.mdx Adjusts sidebar position/title numbering.
docs/docs/examples/env-fallback.mdx Adjusts sidebar position/title numbering.
docs/docs/examples/distribution-and-platform.mdx Adjusts sidebar position/title numbering.
docs/docs/examples/custom-action.mdx Adjusts sidebar position/title numbering.
docs/docs/examples/compiler.mdx Adjusts sidebar position/title numbering.
docs/docs/examples/callback-entry-point.mdx Adjusts sidebar position/title numbering.
docs/docs/examples/bind.mdx Adjusts sidebar position/title numbering.
docs/docs/examples/advanced.mdx Adjusts sidebar position/title numbering.
Files not reviewed (1)
  • docs/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread include/cli/parser.hh Outdated
Comment thread include/cli/parser.hh
Comment thread include/cli/parser.hh
Comment thread include/cli/help.hh Outdated
Comment thread include/cli/relation.hh
@gen740
gen740 enabled auto-merge (rebase) May 12, 2026 10:08
@gen740
gen740 merged commit 30408c2 into main May 12, 2026
9 checks passed
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.

2 participants