Skip to content

fix: document wc, expose help, and correct newline counting - #3277

Open
hengyunabc wants to merge 2 commits into
alibaba:masterfrom
hengyunabc:codex/wc-docs-help
Open

hengyunabc wants to merge 2 commits into
alibaba:masterfrom
hengyunabc:codex/wc-docs-help

Conversation

@hengyunabc

Copy link
Copy Markdown
Collaborator

The wc pipe handler lacks usable command help and dedicated documentation. Its current counter also drops blank lines and can count the same line twice when output arrives in separate writes.

This change registers wc with the command framework so help wc, wc -h, and wc --help work, and shares the -l / --lines option definition with the pipe handler. It adds Chinese and English documentation, command-list links, sidebar entries, and help-list examples.

The counter now counts \n characters using an atomic long. Blank lines count, CRLF counts once, and an unterminated final line does not add a count. Results no longer depend on write boundaries. The help/documentation work and counting fix are kept in separate commits.

Validation:

  • JDK 17: ./mvnw -B -ntp -pl core -am test passed, including 322 core tests (0 failures/errors; 7 existing skips) and dependency-module tests.
  • Added coverage for command registration, general and detailed help, the shell help execution path, both line-count options, independent counters, blank lines, unterminated text, CRLF, fragmented output, and concurrent writes. All six new counting regression cases failed before the fix and passed afterward.
  • npm --prefix site run docs:build passed (158 pages); verified rendered examples, counting rules, and Chinese/English command-list and sidebar links.
  • git diff origin/master...HEAD --check passed.

Full distribution packaging is not verified: a local package attempt passed the tests but stopped because the Web UI build output at web-ui/arthasWebConsole/dist/ui was absent.

Related to #2322.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T12:29:02.323484Z 9881d43 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
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