feat(help): add --help to builtins and extend help command#129
feat(help): add --help to builtins and extend help command#129
Conversation
- break, continue, exit: match bash builtin behaviour (stderr, exit code 2) - echo, true, false: match GNU coreutils behaviour (stdout, exit code 0) - Add scenario tests for all 6 commands - Update existing tests that expected --help to be ignored Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@codex conduct a comprehensive security and code review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 678dd226cf
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
false is a guaranteed failure primitive and should always exit non-zero, even when displaying help text. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
echo is a shell builtin — bash's builtin echo treats --help as literal text, not a flag. Reverts to bash-compatible behaviour. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
true and false are shell builtins — bash ignores all arguments silently. Reverts to bash-compatible behaviour where --help is a no-op. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@codex conduct a comprehensive security and code review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a1a49073cd
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Add per-command help text to all 26 builtins via a new Help field on the Command struct. Running 'help <command>' now displays detailed usage for that command, matching the output of '<command> --help' where supported. This is especially useful for builtins like echo, true, and false that don't support --help (matching bash builtin behaviour). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Bash emits builtin --help output on stdout. Our break, continue, and exit builtins incorrectly wrote to stderr, breaking patterns like 'break --help | head' and 'break --help >file'. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Re-enable bash comparison assertions for break, continue, and exit help scenarios. Add trailing spaces on blank lines to match bash's exact output format. All three scenarios now pass byte-for-byte against debian:bookworm-slim bash. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@codex conduct a comprehensive security and code review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 16731f760d
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…trings Replace static Help field strings on 23 commands with dynamic invocation: help <command> now calls the command's handler with --help and captures the output. Only echo, true, and false retain static Help text since they don't handle --help (matching bash builtin behaviour). This eliminates 418 lines of duplicated help text that would drift out of sync whenever flags are added or changed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
help echo typo now prints usage and exits 1 instead of silently ignoring the extra argument. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@codex conduct a comprehensive security and code review |
|
Codex Review: Didn't find any major issues. 🎉 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Replace single-line escaped strings with multi-line string constants for break, continue, and exit --help output. Easier to read and maintain. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Test plan
🤖 Generated with Claude Code