diff options
Diffstat (limited to 'scripts/documentation-file-ref-check')
-rwxr-xr-x | scripts/documentation-file-ref-check | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/documentation-file-ref-check b/scripts/documentation-file-ref-check index ff16db269079..440227bb55a9 100755 --- a/scripts/documentation-file-ref-check +++ b/scripts/documentation-file-ref-check | |||
@@ -22,9 +22,16 @@ $scriptname =~ s,.*/([^/]+/),$1,; | |||
22 | # Parse arguments | 22 | # Parse arguments |
23 | my $help = 0; | 23 | my $help = 0; |
24 | my $fix = 0; | 24 | my $fix = 0; |
25 | my $warn = 0; | ||
26 | |||
27 | if (! -d ".git") { | ||
28 | printf "Warning: can't check if file exists, as this is not a git tree"; | ||
29 | exit 0; | ||
30 | } | ||
25 | 31 | ||
26 | GetOptions( | 32 | GetOptions( |
27 | 'fix' => \$fix, | 33 | 'fix' => \$fix, |
34 | 'warn' => \$warn, | ||
28 | 'h|help|usage' => \$help, | 35 | 'h|help|usage' => \$help, |
29 | ); | 36 | ); |
30 | 37 | ||
@@ -139,6 +146,8 @@ while (<IN>) { | |||
139 | if (!($ref =~ m/(scripts|Kconfig|Kbuild)/)) { | 146 | if (!($ref =~ m/(scripts|Kconfig|Kbuild)/)) { |
140 | $broken_ref{$ref}++; | 147 | $broken_ref{$ref}++; |
141 | } | 148 | } |
149 | } elsif ($warn) { | ||
150 | print STDERR "Warning: $f references a file that doesn't exist: $fulref\n"; | ||
142 | } else { | 151 | } else { |
143 | print STDERR "$f: $fulref\n"; | 152 | print STDERR "$f: $fulref\n"; |
144 | } | 153 | } |