summaryrefslogtreecommitdiff
path: root/scripts/checkopts.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/checkopts.pl')
-rwxr-xr-xscripts/checkopts.pl15
1 files changed, 10 insertions, 5 deletions
diff --git a/scripts/checkopts.pl b/scripts/checkopts.pl
index bd7cd6e..e5779ca 100755
--- a/scripts/checkopts.pl
+++ b/scripts/checkopts.pl
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-## Copyright © 2010 by Daniel Friesel <derf@derf.homelinux.org>
+## Copyright © 2010 by Birte Kristina Friesel <derf@finalrewind.org>
## License: WTFPL <http://sam.zoy.org/wtfpl>
use strict;
use warnings;
@@ -9,15 +9,20 @@ my $options;
open(my $c_fh, '<', 'src/options.c') or die("Can't read options.c: $!");
while (my $line = <$c_fh>) {
- if ($line =~ /\{"(?<long>[\w-]+)",.*,\s*(?:'(?<short>.)'|(?<short>\d+))\}/o) {
+ if ($line =~ /\{"(?<long>[\w-]+)"\s*,.*,\s*(?:'(?<short>.)'|(?<short>\d+))\}/o) {
push(@{$options->{$+{long}}}, ['source', $+{short}]);
}
- elsif ($line =~ /" (?:\-(?<short>.), |\s*)--(?<long>[\w-]+) /) {
+}
+close($c_fh);
+
+open(my $h_fh, '<', 'src/help.raw') or die("Can't read help.raw: $!");
+while (my $line = <$h_fh>) {
+
+ if ($line =~ /^ (?:\-(?<short>.), |\s*)--(?<long>[\w-]+) /) {
push(@{$options->{$+{long}}}, ['help', $+{short}]);
}
-
}
-close($c_fh);
+close($h_fh);
open(my $man_fh, '<', 'man/feh.1') or die("Can't read feh.1: $!");
while (my $line = <$man_fh>) {