@@ -6817,7 +6817,7 @@ our $hierarchical = 0; # if true: show directory hierarchy
68176817 # default: legacy two-level report
68186818our $flat = 0; # if true: single table of all files in top level
68196819
6820- our $sort = 1; # If set, provide directory listings with sorted entries
6820+ our $sort_tables = 1; # If set, provide directory listings with sorted entries
68216821our $no_sort ; # Disable sort
68226822our $frames ; # If set, use frames for source code view
68236823our $keep_descriptions ; # If set, do not remove unused test case descriptions
@@ -6899,7 +6899,7 @@ my %genhtml_rc_opts = (
68996899 " genhtml_mcdc_field_width" => \$mcdc_field_width ,
69006900 " genhtml_owner_field_width" => \$owner_field_width ,
69016901 " genhtml_age_field_width" => \$age_field_width ,
6902- " genhtml_sort" => \$sort ,
6902+ " genhtml_sort" => \$sort_tables ,
69036903 " genhtml_charset" => \$charset ,
69046904 " genhtml_desc_html" => \$rc_desc_html ,
69056905 ' merge_function_aliases' => \$merge_function_aliases ,
@@ -6975,7 +6975,7 @@ my %genhtml_options = ("output-directory|o=s" => \$output_directory,
69756975 " html-gzip" => \$html_gzip ,
69766976 " hierarchical" => \$hierarchical ,
69776977 " flat" => \$flat ,
6978- " sort" => \$sort ,
6978+ " sort-tables " => \$sort_tables ,
69796979 " no-sort" => \$no_sort ,
69806980 " precision=i" => \$lcovutil::default_precision ,
69816981 " missed" => \$opt_missed ,
@@ -6985,6 +6985,15 @@ my %genhtml_options = ("output-directory|o=s" => \$output_directory,
69856985 " merge-aliases" => \$merge_function_aliases ,
69866986 " suppress-aliases" => \$suppress_function_aliases ,
69876987 ' validate' => \$validateHTML ,);
6988+
6989+ # remove ambiguous entry from common table -
6990+ # (genhtml has '--sort-inputs' and '--sort-tables')
6991+ # handle the (no obsolete) '--sort' option
6992+ Getopt::Long::Configure(" pass_through" , " no_auto_abbrev" );
6993+ my $obsoleteSort ;
6994+ Getopt::Long::GetOptions(' sort' => \$obsoleteSort );
6995+ Getopt::Long::Configure(' default' );
6996+
69886997# Parse command line options
69896998if (
69906999 !lcovutil::parseOptions(\%genhtml_rc_opts , \%genhtml_options ,
@@ -6994,6 +7003,13 @@ if (
69947003 exit (1);
69957004}
69967005
7006+ if (defined ($obsoleteSort )) {
7007+ $sort_tables = $obsoleteSort ;
7008+ lcovutil::ignorable_warning($lcovutil::ERROR_DEPRECATED ,
7009+ " option '--sort' is deprecated and will be removed in a future release; please use '--sort-tables' instead."
7010+ );
7011+ }
7012+
69977013$merge_function_aliases = 1
69987014 if ($suppress_function_aliases ||
69997015 defined ($lcovutil::cov_filter [$lcovutil::FILTER_FUNCTION_ALIAS ]));
@@ -7037,7 +7053,7 @@ if (defined($lcovutil::stop_on_error) &&
70377053}
70387054
70397055# Merge sort options
7040- $sort = 0
7056+ $sort_tables = 0
70417057 if ($no_sort );
70427058die (
70437059 " unsupported use of mutually exclusive '--flat' and '--hierachical' options" )
@@ -7244,7 +7260,7 @@ if ($no_prefix && @dir_prefix) {
72447260@fileview_sortlist = ($SORT_FILE );
72457261@funcview_sortlist = ($SORT_FILE );
72467262
7247- if ($sort ) {
7263+ if ($sort_tables ) {
72487264 push (@fileview_sortlist , $SORT_LINE );
72497265 push (@fileview_sortlist , $SORT_FUNC ) if ($lcovutil::func_coverage );
72507266 push (@fileview_sortlist , $SORT_BRANCH ) if ($lcovutil::br_coverage );
@@ -8659,7 +8675,7 @@ sub write_png_files()
86598675 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
86608676 ];
86618677
8662- if ($sort ) {
8678+ if ($sort_tables ) {
86638679 $data {" updown.png" } =
86648680 $dark_mode ?
86658681 [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00,
@@ -11960,7 +11976,7 @@ sub write_header(*$$$$$$$)
1196011976 %$differentialFunctionMap ) {
1196111977 $view .= " <span style=\" font-size: 80%;\" >" ;
1196211978 if ($type == $HDR_SOURCE ) {
11963- my $suffix = $sort ? ' -c' : ' ' ;
11979+ my $suffix = $sort_tables ? ' -c' : ' ' ;
1196411980 $view .=
1196511981 " (source / <a href=\" $base_name .func$suffix .$html_ext \" title=\" Click to go to function table\" >functions</a>)" ;
1196611982 } elsif ($type == $HDR_FUNC ) {
@@ -12652,7 +12668,7 @@ sub write_file_table(*$$$$$$)
1265212668 }
1265312669 my $file_col_title = ($fileview || $main::flat ) ? ' File' : ' Directory' ;
1265412670 # don't insert the 'sort' controls if there is just a single source file
12655- my $use_sort_button = $sort && 1 < scalar ($dirSummary -> sources());
12671+ my $use_sort_button = $sort_tables && 1 < scalar ($dirSummary -> sources());
1265612672 my $file_code =
1265712673 get_file_code($hide , $file_col_title ,
1265812674 $use_sort_button && $sort_type != $SORT_FILE ,
@@ -13372,23 +13388,23 @@ sub funcview_get_label($$$$)
1337213388 my $link ;
1337313389
1337413390 if (!defined ($col )) {
13375- if ($sort && $sort_type != $SORT_FILE ) {
13391+ if ($sort_tables && $sort_type != $SORT_FILE ) {
1337613392 $link = " $name .func.$html_ext " ;
1337713393 }
1337813394 return " Function Name" . get_sort_code($link , " function name" , $base );
1337913395 } elsif ($col eq ' hit' ) {
13380- if ($sort && $sort_type != $SORT_LINE ) {
13396+ if ($sort_tables && $sort_type != $SORT_LINE ) {
1338113397 $link = " $name .func-c.$html_ext " ;
1338213398 }
1338313399 return " Hit count" . get_sort_code($link , " function hit count" , $base );
1338413400 } elsif ($col eq ' missed_line' ) {
13385- if ($sort && $sort_type != $SORT_MISSING_LINE ) {
13401+ if ($sort_tables && $sort_type != $SORT_MISSING_LINE ) {
1338613402 $link = " $name .func-l.$html_ext " ;
1338713403 }
1338813404 return " Lines" .
1338913405 get_sort_code($link , " unexercised lines in function" , $base );
1339013406 } elsif ($col eq ' missed_mcdc' ) {
13391- if ($sort && $sort_type != $SORT_MISSING_MCDC ) {
13407+ if ($sort_tables && $sort_type != $SORT_MISSING_MCDC ) {
1339213408 $link = " $name .func-m.$html_ext " ;
1339313409 }
1339413410 return " MC/DC"
@@ -13397,7 +13413,7 @@ sub funcview_get_label($$$$)
1339713413 $base );
1339813414 } else {
1339913415 die (" unexpected sort $col " ) unless ($col eq ' missed_branch' );
13400- if ($sort && $sort_type != $SORT_MISSING_BRANCH ) {
13416+ if ($sort_tables && $sort_type != $SORT_MISSING_BRANCH ) {
1340113417 $link = " $name .func-b.$html_ext " ;
1340213418 }
1340313419 return " Branches" .
0 commit comments