|
184 | 184 | $opt_timeout ,
|
185 | 185 | $opt_html ,
|
186 | 186 | $opt_ignored ,
|
| 187 | + $opt_unique , |
187 | 188 | $opt_counted ,
|
188 | 189 | $opt_show_ext ,
|
189 | 190 | $opt_show_lang ,
|
@@ -297,6 +298,7 @@ my $getopt_success = GetOptions( # {{{1
|
297 | 298 | "timeout=i" => \$opt_timeout ,
|
298 | 299 | "html" => \$opt_html ,
|
299 | 300 | "ignored=s" => \$opt_ignored ,
|
| 301 | + "unique=s" => \$opt_unique , |
300 | 302 | "quiet" => \$opt_quiet ,
|
301 | 303 | "force_lang_def|force-lang-def=s" => \$opt_force_lang_def ,
|
302 | 304 | "read_lang_def|read-lang-def=s" => \$opt_read_lang_def ,
|
@@ -402,6 +404,7 @@ load_from_config_file($config_file, # {{{2
|
402 | 404 | \$opt_timeout ,
|
403 | 405 | \$opt_html ,
|
404 | 406 | \$opt_ignored ,
|
| 407 | + \$opt_unique , |
405 | 408 | \$opt_quiet ,
|
406 | 409 | \$opt_force_lang_def ,
|
407 | 410 | \$opt_read_lang_def ,
|
@@ -1359,6 +1362,8 @@ foreach my $FH (@fh) { # loop over each pair of file sets
|
1359 | 1362 | $n_set,
|
1360 | 1363 | plural_form(scalar keys %unique_source_file)
|
1361 | 1364 | unless $opt_quiet;
|
| 1365 | + my $suffix = $n_set == 1 ? "L" : "R"; |
| 1366 | + write_file("${opt_unique}_${suffix}", {}, sort keys %unique_source_file) if $opt_unique; |
1362 | 1367 | }
|
1363 | 1368 | # 1}}}
|
1364 | 1369 | # Step 6: Count code, comments, blank lines. {{{1
|
@@ -1618,6 +1623,7 @@ if ($opt_exclude_content) {
|
1618 | 1623 | printf "%8d unique file%s. \n",
|
1619 | 1624 | plural_form(scalar keys %unique_source_file)
|
1620 | 1625 | unless $opt_quiet;
|
| 1626 | +write_file($opt_unique, {}, sort keys %unique_source_file) if $opt_unique; |
1621 | 1627 | # 1}}}
|
1622 | 1628 | # Step 6: Count code, comments, blank lines. {{{1
|
1623 | 1629 | #
|
@@ -14635,6 +14641,7 @@ sub load_from_config_file { # {{{1
|
14635 | 14641 | $rs_timeout ,
|
14636 | 14642 | $rs_html ,
|
14637 | 14643 | $rs_ignored ,
|
| 14644 | + $rs_unique , |
14638 | 14645 | $rs_quiet ,
|
14639 | 14646 | $rs_force_lang_def ,
|
14640 | 14647 | $rs_read_lang_def ,
|
@@ -14746,6 +14753,7 @@ sub load_from_config_file { # {{{1
|
14746 | 14753 | } elsif (!defined ${$rs_timeout} and /^timeout(=|\s+)i/) { ${$rs_timeout} = $1;
|
14747 | 14754 | } elsif (!defined ${$rs_html} and /^html/) { ${$rs_html} = 1;
|
14748 | 14755 | } elsif (!defined ${$rs_ignored} and /^ignored(=|\s+)(.*?)$/) { ${$rs_ignored} = $2;
|
| 14756 | + } elsif (!defined ${$rs_unique} and /^unique(=|\s+)(.*?)$/) { ${$rs_unique} = $2; |
14749 | 14757 | } elsif (!defined ${$rs_quiet} and /^quiet/) { ${$rs_quiet} = 1;
|
14750 | 14758 | } elsif (!defined ${$rs_force_lang_def} and /^(?:force_lang_def|force-lang-def)(=|\s+)(.*?)$/) { ${$rs_force_lang_def} = $2;
|
14751 | 14759 | } elsif (!defined ${$rs_read_lang_def} and /^(?:read_lang_def|read-lang-def)(=|\s+)(.*?)$/) { ${$rs_read_lang_def} = $2;
|
|
0 commit comments