Skip to content

[FIX] Accept the remaining legacy option spellings - #2383

Merged
cfsmp3 merged 1 commit into
masterfrom
fix/remaining-legacy-options
Oct 17, 2026
Merged

cfsmp3 merged 1 commit into
masterfrom
fix/remaining-legacy-options

Conversation

@cfsmp3

@cfsmp3 cfsmp3 commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

In raising this pull request, I confirm the following (please check boxes):

Reason for this PR:

  • This PR adds new functionality.
  • This PR fixes a bug that I have personally experienced or that a real user has reported and for which a sample exists.
  • This PR is porting code from C to Rust.

Sanity check:

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • If the PR adds new functionality, I've added it to the changelog. If it's just a bug fix, I have NOT added it to the changelog.
  • I am NOT adding new C code unless it's to fix an existing, reproducible bug.

Repro instructions:

On master, any of these fails with Unknown Argument (exit 7) on any input, e.g. ccextractor input.ts -nofc:
-bi -nobi --nobufferinput -ff -bs -nofc --nofontcolor --nohtmlescape -nots --notypesetting -ntm --no-timestamp-map -nocodec -nospupngocr --transcript --timedtranscript -ve -gt -nogt --nogoptime -fp --norollup -key --gui_mode_reports --no_progress_bar -sbs -caf -pn -dc -scr -nolevdist -anvid -investigate_packets -nosync -haup -poc -tcppassword -tcpdesc -tickertape -ocr_mode -sub_color -min_sub_duration -detect_italics -conf_thresh -whiteness_thresh -lum_thresh


Follow-up to #2368. The v0.94 C parser accepted these spellings; the Rust parser rejects them, so old scripts and frontends break. #2368 covered nine; this covers the remaining 46 that still have an equivalent option.

  • Each spelling is a hidden clap alias on the option with the same behaviour (checked against the v0.94 params.c and parser.rs), so --help is unchanged and normalize_legacy_args still skips option values.
  • -ntm / --no-timestamp-map: v0.94 wrote WebVTT's X-TIMESTAMP-MAP header by default and this turned it off. The header is now off unless --timestamp-map is given, so these are accepted as a hidden no-op (and conflict with --timestamp-map).
  • -pn needs a value now; v0.94 also allowed a bare -pn for autodetect.
  • Not mapped: -enable-sharing, -sharing-url, -sharing-debug, -translate, -translate-auth — the sharing/translation feature no longer exists, so accepting them would silently do nothing. -curlposturl already works in libcurl builds, as in v0.94.

Verified:

  • New tests: every mapped spelling parses to exactly the same Args as its modern spelling; the removed-feature spellings stay rejected; a legacy-looking option value is not rewritten. They fail without the change.
  • --help is byte-identical to master.
  • End to end, each of the 46 legacy spellings gives byte-identical output and exit code to its modern spelling.
  • 24 local samples × 5 option sets: identical to master, except the set using -nofc, which master rejects and which now matches --no-fontcolor.

The C parser in v0.94 accepted short and underscore spellings such as
-nofc, -bi, -gt, -haup, -ocr_mode and --gui_mode_reports. The Rust
parser rejects 46 of them with "Unknown Argument", so old scripts and
frontends stop working. #2368 covered nine; this covers the rest that
still have an equivalent option.

Each spelling becomes a hidden clap alias on the option with the same
behaviour, so --help is unchanged and option values are still skipped
by normalize_legacy_args. -ntm/--no-timestamp-map get a hidden no-op
flag: v0.94 wrote the X-TIMESTAMP-MAP header by default and this
turned it off, but the header is now off unless --timestamp-map is
given.

The sharing and translation options (-enable-sharing, -sharing-url,
-sharing-debug, -translate, -translate-auth) stay rejected because
that feature no longer exists. -curlposturl already works in builds
with libcurl, as in v0.94.
@cfsmp3
cfsmp3 force-pushed the fix/remaining-legacy-options branch from 8740344 to 4b756e3 Compare October 17, 2026 23:39
@cfsmp3
cfsmp3 merged commit 8ed9231 into master Oct 17, 2026
47 of 49 checks passed
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.

1 participant