Skip to content

[core] 80-character help formatting + Fix CJK description issues in zsh and fish#50

Merged
forfudan merged 7 commits intomainfrom
help
Apr 14, 2026
Merged

[core] 80-character help formatting + Fix CJK description issues in zsh and fish#50
forfudan merged 7 commits intomainfrom
help

Conversation

@forfudan
Copy link
Copy Markdown
Owner

@forfudan forfudan commented Apr 14, 2026

This PR updates ArgMojo’s CLI help generation to use a consistent 80-column two-column layout with wrapping, and adjusts shell completion/help expectations (including changes aimed at better handling of non-ASCII text).

Changes:

  • Add shared help-layout constants and new wrapping/formatting helpers in utils.mojo.
  • Refactor Command._generate_help() sections (usage/options/commands/args) to use the new two-column formatting and wrap long content.
  • Update tests and examples to match the new help formatting and the built-in completions trigger naming/placeholder output.

Copy link
Copy Markdown

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

Updates ArgMojo’s CLI help generation to use a consistent 80-column two-column layout with wrapping, and adjusts shell completion/help expectations (including changes aimed at better handling of non-ASCII text).

Changes:

  • Add shared help-layout constants and new wrapping/formatting helpers in utils.mojo.
  • Refactor Command._generate_help() sections (usage/options/commands/args) to use the new two-column formatting and wrap long content.
  • Update tests and examples to match the new help formatting and the built-in completions trigger naming/placeholder output.

Reviewed changes

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

Show a summary per file
File Description
tests/test_options.mojo Makes deprecated-tag assertions less brittle to formatting/wrapping changes.
tests/test_help.mojo Updates dynamic-padding test to account for overflow + wrapped descriptions.
tests/test_completion.mojo Updates completion/help expectations for the built-in completions trigger and placeholder text.
src/argmojo/utils.mojo Introduces 80-column help layout constants and wrapping/two-column formatting helpers.
src/argmojo/command.mojo Refactors help generation to the new layout/wrapping; updates completions trigger default; improves Unicode-safe escaping loops.
examples/yu.mojo Adds explicit newlines in CJK help strings to control wrapping/line breaks.
docs/argmojo_overall_planning.md Marks 80-character help formatting as completed and adds planning notes.
Comments suppressed due to low confidence (1)

src/argmojo/command.mojo:4907

  • In _fish_escape, text.codepoint_slices() yields slices; appending ch directly (result += ch) is inconsistent with _zsh_escape (which uses String(ch)) and may not type-check/compile. Convert ch to String before concatenation (and keep comparisons consistent) to ensure Unicode-safe escaping works.
        for ch in text.codepoint_slices():
            if ch == "'":
                result += "\\'"
            else:
                result += ch

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

@forfudan forfudan merged commit 028c5d5 into main Apr 14, 2026
5 checks passed
@forfudan forfudan deleted the help branch April 14, 2026 20:12
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