[T-224] ocagent upload/download/clean/suicide 補上 --help 說明文字 - #509
Open
8thEdition wants to merge 2 commits into
Open
8thEdition wants to merge 2 commits into
8thEdition wants to merge 2 commits into
Conversation
…-224) Only diff set a FlagSet Usage, so `ocagent upload --help` and the other subcommands printed the bare stdlib flag list while the boot docs tell members to read `ocagent <subcommand> --help`. Each text sits beside its implementation, like diffUsage, and TestRealMain pins it through dispatch. listen, context-report, guard-bash and guard-permission are launched by wiring, and version takes no flags; they are left as they were. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
clean: the agents home falls back to ~/.officraft/agents (or ~/.officraft-<ns>/agents), so an unset OC_AGENT_HOME is not an rc-2 case; list the real rc-2 causes and the rc-1 and missing-identity stdout lines. suicide: --help and any other flag parse error exit 2, not 0. upload: without --mime the server recognises four image formats by bytes and only .json by name; everything else is application/octet-stream. download: default dir is the current directory; a 404 may mean OC_BASE points at the wrong station. rc-2 rows now name --help and flag errors. Like the previous commit, this changes only what `<subcommand> --help` and a flag-parse error print to stdout. Exit codes, stderr and the normal output of every subcommand are unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
為什麼
開機文件教成員用
ocagent <subcommand> --help查用法,並點名 upload/download,但整個 ocagent 只有 diff 有說明文字,其他子命令只印出旗標列表或空白。做了什麼
xxxUsage函式+fs.Usage)替 upload、download、clean、suicide 補說明:用途、參數、輸出、結束碼、常見錯誤。每句對照程式碼查證,不寫死由伺服器決定的上限。TestRealMain擴充 5 個子測試,經由 realMain 實跑各子命令--help斷言手寫字面值。行為變化
只有
<subcommand> --help與旗標解析錯誤時 stdout 印的內容變了;結束碼、stderr、各子命令的一般輸出都不變(獨立審查以 main 與候選各 build 一顆、31 組輸入比對確認)。驗證
已知限制
說明文字與實際結束碼之間沒有測試綁定,行為改了而說明沒改不會變紅。
🤖 Generated with Claude Code