tool: support fractions for --limit-rate and --max-filesize#20266
Closed
tool: support fractions for --limit-rate and --max-filesize#20266
Conversation
|
Analysis of PR #20266 at be1b5876: Test 3024 failed, which has NOT been flaky recently, so there could be a real issue in this PR. Note that this test has failed in 12 different CI jobs (the link just goes to one of them). Generated by Testclutch |
be1b587 to
ce68df0
Compare
66ce0d9 to
cac565d
Compare
This comment was marked as resolved.
This comment was marked as resolved.
3cf1bf3 to
8663c3e
Compare
This comment was marked as resolved.
This comment was marked as resolved.
vszakats
added a commit
that referenced
this pull request
Jan 12, 2026
Also: - drop separate check for 3 or more consecutive empty lines. Ref: #20266 (comment) Closes #20269
Allow 2.5k or 3.7M etc. Add mention in documentation. Verify in test case 1623.
8663c3e to
2a1c268
Compare
There was a problem hiding this comment.
Pull request overview
This pull request adds support for fractional values in the --limit-rate and --max-filesize command-line options. Users can now specify values like 2.5k or 3.7M instead of being limited to integers.
Changes:
- Refactored
GetSizeParameterfunction to parse and handle fractional values with unit suffixes - Added comprehensive unit test (test1623) covering various fractional input formats and edge cases
- Updated documentation for both
--limit-rateand--max-filesizeto explain fractional value support
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tool_getparam.c | Rewrote GetSizeParameter to support fractional values, added unit lookup helper function |
| src/tool_getparam.h | Exposed GetSizeParameter for unit testing |
| tests/tunit/tool1623.c | Added comprehensive unit test for size parameter parsing with fractional values |
| tests/tunit/Makefile.inc | Added new unit test to build system |
| tests/data/test1623 | Added test case definition |
| tests/data/Makefile.am | Registered new test in test suite |
| docs/cmdline-opts/max-filesize.md | Documented fractional value support, added example |
| docs/cmdline-opts/limit-rate.md | Documented fractional value support, updated example |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Allow
2.5kor3.7Metc. Add mention in documentation.Verify in test case 1623.