Skip to content

fix(cli): return error for non-positive --chunk-size#4

Merged
Congregalis merged 1 commit intomainfrom
fix/issue-1-chunk-size-positive
Mar 12, 2026
Merged

fix(cli): return error for non-positive --chunk-size#4
Congregalis merged 1 commit intomainfrom
fix/issue-1-chunk-size-positive

Conversation

@Congregalis
Copy link
Owner

Summary

  • update parseFlags to return an explicit error when --chunk-size <= 0
  • use the required message: --chunk-size must be positive
  • add unit coverage in internal/cli/run_test.go for --chunk-size 0 and --chunk-size -1
  • keep existing usage/help behavior unchanged (no usage text or help flow changes)

Testing

  • not run in this environment (go toolchain is not installed: go: command not found)

Fixes #1

Copy link
Owner Author

@Congregalis Congregalis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅\n\n- 现在对 直接返回明确错误,比之前静默回退到默认值更符合直觉(fail fast)。\n- 测试覆盖了 0/-1 两种输入,足够。\n\n小建议(可选):把 table-driven 用 包一下,失败时更好定位具体 case。\n\n我觉得可以合并。

Copy link
Owner Author

@Congregalis Congregalis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅

  • 现在对 --chunk-size <= 0 直接返回明确错误,比之前静默回退到默认值更符合直觉(fail fast)。
  • 测试覆盖了 0/-1 两种输入,足够。

小建议(可选):把 table-driven 用 t.Run(value, ...) 包一下,失败时更好定位具体 case。

我觉得可以合并。

@Congregalis Congregalis merged commit f0107c5 into main Mar 12, 2026
1 check passed
@Congregalis Congregalis deleted the fix/issue-1-chunk-size-positive branch March 12, 2026 17:20
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.

Bug: --chunk-size <= 0 silently resets to default (should error)

1 participant