mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-07-08 18:06:30 +00:00
[PR #1856] [MERGED] fix(args): Add backward compatibility for single-dash long options #2621
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/CCExtractor/ccextractor/pull/1856
Author: @cfsmp3
Created: 12/20/2025
Status: ✅ Merged
Merged: 12/20/2025
Merged by: @cfsmp3
Base:
master← Head:fix/issue-1576-legacy-single-dash-options📝 Commits (2)
dd3dab7fix(args): Add backward compatibility for single-dash long options (#1576)77624ecstyle: Run cargo fmt on Rust code📊 Changes
1 file changed (+117 additions, -0 deletions)
View changed files
📝
src/rust/src/lib.rs(+117 -0)📄 Description
Summary
-quiet(single-dash) instead of--quiet(double-dash) would fail silently with exit code 7 and produce zero-length output filesnormalize_legacy_option()function that pre-processes command-line arguments to convert legacy single-dash long options to double-dash format before passing to clap-oRoot Cause
The Rust-based argument parser (clap) only accepts double-dash long options (
--quiet), but old versions of ccextractor accepted single-dash (-quiet). When clap received-quiet, it parsed it as five individual short options-q -u -i -e -t. Since-qwasn't defined, it failed with exit code 7.Users with scripts that redirected stderr (
> /dev/null 2>&1) never saw the error message, causing the "intermittent" zero-length output described in the issue.Changes
src/rust/src/lib.rs:
normalize_legacy_option()function that converts single-dash long options to double-dashTest Results
-quiet--quiet-stdout-autoprogram-o)-1,-12)All 292 Rust tests pass (286 existing + 6 new).
Test plan
-quietnow works (was failing before)--quietstill works-ostill work-1,-12still workFixes #1576
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.