Skip to content

Return non-zero exit code on conversion failure - #1072

Merged
BYVoid merged 1 commit into
masterfrom
claude/fix-opencc-969-rt5o0
Mar 27, 2026
Merged

BYVoid merged 1 commit into
masterfrom
claude/fix-opencc-969-rt5o0

Conversation

@BYVoid

@BYVoid BYVoid commented Mar 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • When opencc or opencc_dict encounters an error (e.g. config file not found), the process now exits with code 1 instead of always returning 0.
  • This allows shell scripts and other tools to properly detect conversion failures via $?.

Test plan

  • Verified opencc -i /dev/null -c gg.json now returns exit code 1
  • Built both opencc and opencc_dict successfully
  • Verify successful conversions still return exit code 0

Fixes #969

When opencc or opencc_dict encounters an error (e.g. config file not
found), the process now exits with code 1 instead of 0. This allows
shell scripts and other tools to detect conversion failures.

Fixes #969

https://claude.ai/code/session_019NsFdBhXY59ogGvvMQCHN8
@BYVoid
BYVoid merged commit 71ffd34 into master Mar 27, 2026
31 of 33 checks passed
Copilot AI mentioned this pull request Apr 17, 2026
3 tasks done
@frankslin
frankslin deleted the claude/fix-opencc-969-rt5o0 branch April 19, 2026 01:44
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.

Command line 轉換不成功時,應提供非 0 的退出碼

2 participants