Skip to content

Clarify --fixed-crop help text - #81

Merged
wdecoster merged 2 commits into
wdecoster:masterfrom
JMencius:master
Sep 13, 2026
Merged

wdecoster merged 2 commits into
wdecoster:masterfrom
JMencius:master

Conversation

@JMencius

Copy link
Copy Markdown
Contributor

I noticed a small documentation error in README.md while using chopper v0.14.0.

When using --trim-approach fixed-crop, only one of --headcrop or --tailcrop needs to be greater than 0; they are not both required.

This matches the validation logic in src/main.rs (lines 248–253):

if args.headcrop == 0 && args.tailcrop == 0 {
    eprintln!(
        "Error: When using the 'fixed-crop' trimming approach, at least one of --headcrop or --tailcrop must be greater than 0."
    );
    std::process::exit(1);
}

A minimal test using only --headcrop also confirms this behavior:

$ printf '@test\nACGTACGT\n+\nIIIIIIII\n' |
    chopper --trim-approach fixed-crop --headcrop 2

@test
GTACGT
+
IIIIII
Kept 1 reads out of 1 reads

JMencius and others added 2 commits September 13, 2026 22:30
The README options block is a paste of `chopper --help`, so correcting it
there alone leaves `--help` wrong and the fix gets reverted on the next
regeneration. Apply the same correction to the doc comments the help text
is generated from, and note on --headcrop/--tailcrop that neither is
required on its own.

While there, --cutoff is also required by split-by-low-quality (main.rs
:292), which its doc comment did not mention, and regenerate the README
block so it matches the binary exactly.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXEe5HBFCS7israxADWkU4
@wdecoster

Copy link
Copy Markdown
Owner

Thanks @JMencius — good catch, and thanks for digging up the validation code and a reproducer along with it. You were exactly right: only one of --headcrop/--tailcrop has to be non-zero.

The README options block is a paste of chopper --help, so I pushed a follow-up commit to your branch applying the same correction to the FixedCrop doc comment in src/main.rs that the help text is generated from — otherwise chopper --help would keep printing the old sentence and your fix would have been overwritten the next time the README was regenerated. I also noted on --headcrop/--tailcrop that neither is required on its own, fixed --cutoff (it is required by split-by-low-quality too, which its doc comment did not say), and regenerated the block so the README matches the binary exactly.

Merging now, and it will go out in the next release.

@wdecoster
wdecoster merged commit f216d3c into wdecoster:master Sep 13, 2026
1 check passed
@JMencius

JMencius commented Sep 13, 2026 via email

Copy link
Copy Markdown
Contributor Author

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.

2 participants