Skip to content

[core] Move print_summary from Command to ParseResult#24

Merged
forfudan merged 2 commits intomainfrom
update
Mar 11, 2026
Merged

[core] Move print_summary from Command to ParseResult#24
forfudan merged 2 commits intomainfrom
update

Conversation

@forfudan
Copy link
Owner

@forfudan forfudan commented Mar 11, 2026

This PR moves the parsed-argument summary printing utility from Command onto ParseResult, making it callable directly on parse results (and updating examples accordingly).

Changes:

  • Added ParseResult.print_summary() (with recursive subcommand printing).
  • Removed Command.print_summary(result).
  • Updated example CLIs to call result.print_summary().

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Moves the parsed-argument summary printing utility from Command onto ParseResult, making it callable directly on parse results (and updating examples accordingly).

Changes:

  • Added ParseResult.print_summary() (with recursive subcommand printing).
  • Removed Command.print_summary(result).
  • Updated example CLIs to call result.print_summary().

Reviewed changes

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

Show a summary per file
File Description
src/argmojo/parse_result.mojo Adds print_summary() implementation on ParseResult, including subcommand recursion and unknown-args display.
src/argmojo/command.mojo Removes the Command.print_summary() helper.
examples/mgrep.mojo Updates example to call result.print_summary().
examples/mgit.mojo Updates example to call result.print_summary().
examples/demo.mojo Updates example to call result.print_summary().

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

You can also share your feedback on Copilot code review. Take the survey.

@forfudan forfudan merged commit 1439444 into main Mar 11, 2026
2 checks passed
@forfudan forfudan deleted the update branch March 11, 2026 22:06
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