Skip to content

Commit 05d8ef3

Browse files
committed
Fix CLI argument parsing to use hyphens in hardsubx parameters
- Change --conf_thresh to --conf-thresh - Change --detect_italics to --detect-italics - Change --whiteness_thresh to --whiteness-thresh - Change --ocr_mode to --ocr-mode - Change --min_sub_duration to --min-sub-duration This matches the convention of using hyphens in CLI arguments while keeping underscores in variable names.
1 parent 1756aa6 commit 05d8ef3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/rust/src/args.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ http://www.ccextractor.org
4747
#[command(
4848
help_template = "{name} {version}, {author}.\n{about}\n {all-args} {tab}\n
4949
An example command for burned-in subtitle extraction is as follows:
50-
ccextractor video.mp4 --hardsubx --subcolor white --detect_italics --whiteness_thresh 90 --conf_thresh 60
50+
ccextractor video.mp4 --hardsubx --subcolor white --detect-italics --whiteness-thresh 90 --conf-thresh 60
5151
5252
Notes on File name related options:
5353
You can pass as many input files as you need. They will be processed in order.
@@ -876,7 +876,7 @@ pub struct Args {
876876
/// or letter wise.
877877
/// e.g. --ocr-mode frame (default), --ocr-mode word,
878878
/// --ocr-mode letter
879-
#[arg(long, verbatim_doc_comment, value_name="mode", help_heading=BURNEDIN_SUBTITLE_EXTRACTION)]
879+
#[arg(long = "ocr-mode", verbatim_doc_comment, value_name="mode", help_heading=BURNEDIN_SUBTITLE_EXTRACTION)]
880880
pub ocr_mode: Option<String>,
881881
/// Specify the color of the subtitles
882882
/// Possible values are in the set
@@ -893,29 +893,29 @@ pub struct Args {
893893
/// A lower value gives better results, but takes more
894894
/// processing time.
895895
/// The recommended value is 0.5 (default).
896-
/// e.g. --min_sub_duration 1.0 (for a duration of 1 second)
897-
#[arg(long, verbatim_doc_comment, value_name="duration", help_heading=BURNEDIN_SUBTITLE_EXTRACTION)]
896+
/// e.g. --min-sub-duration 1.0 (for a duration of 1 second)
897+
#[arg(long = "min-sub-duration", verbatim_doc_comment, value_name="duration", help_heading=BURNEDIN_SUBTITLE_EXTRACTION)]
898898
pub min_sub_duration: Option<f32>,
899899
/// Specify whether italics are to be detected from the
900900
/// OCR text.
901901
/// Italic detection automatically enforces the OCR mode
902902
/// to be word-wise
903-
#[arg(long, verbatim_doc_comment, help_heading=BURNEDIN_SUBTITLE_EXTRACTION)]
903+
#[arg(long = "detect-italics", verbatim_doc_comment, help_heading=BURNEDIN_SUBTITLE_EXTRACTION)]
904904
pub detect_italics: bool,
905905
/// Specify the classifier confidence threshold between
906906
/// 1 and 100.
907907
/// Try and use a threshold which works for you if you get
908908
/// a lot of garbage text.
909-
/// e.g. --conf_thresh 50
910-
#[arg(long, verbatim_doc_comment, help_heading=BURNEDIN_SUBTITLE_EXTRACTION)]
909+
/// e.g. --conf-thresh 50
910+
#[arg(long = "conf-thresh", verbatim_doc_comment, help_heading=BURNEDIN_SUBTITLE_EXTRACTION)]
911911
pub conf_thresh: Option<f32>,
912912
/// For white subtitles only, specify the luminance
913913
/// threshold between 1 and 100
914914
/// This threshold is content dependent, and adjusting
915915
/// values may give you better results
916916
/// Recommended values are in the range 80 to 100.
917917
/// The default value is 95
918-
#[arg(long, verbatim_doc_comment, value_name="threshold", help_heading=BURNEDIN_SUBTITLE_EXTRACTION)]
918+
#[arg(long = "whiteness-thresh", verbatim_doc_comment, value_name="threshold", help_heading=BURNEDIN_SUBTITLE_EXTRACTION)]
919919
pub whiteness_thresh: Option<f32>,
920920
/// This option will be used if the file should have both
921921
/// closed captions and burned in subtitles

0 commit comments

Comments
 (0)