update parse-descriptor.pl

libdivecomputer is a submodule. Just hardcode the path to descriptor.c.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2019-07-15 11:22:10 -07:00
parent 3e5d60d95a
commit 9b63b6d5e1

View file

@ -4,19 +4,17 @@
# #
# Usage: # Usage:
# #
# parse-descriptor.pl <path to libdivecomputer/src/descriptor.c> <outfile> # parse-descriptor.pl <outfile>
# #
# depending on suffix of the outfile it creates the right content for # depending on suffix of the outfile it creates the right content for
# either a text file or and html file # either a text file or and html file
use Carp; use Carp;
#set command line arguments #set command line arguments
my ($infi, $outfi) = @ARGV; my $outfi = $ARGV[0];
my ($type) = $outfi =~ /\.([^.]+)$/; my ($type) = $outfi =~ /\.([^.]+)$/;
if ($infi !~ /.*descriptor.c/) { my $infi = "libdivecomputer/src/descriptor.c";
croak "run as $ARGV[0] <path to descriptor.c> <outputfile>\n";
}
open(my $fh, "<", $infi) || croak "can't open $infi: $!"; open(my $fh, "<", $infi) || croak "can't open $infi: $!";
open(STDOUT, ">", $outfi) || croak "can't open $outfi: $!"; open(STDOUT, ">", $outfi) || croak "can't open $outfi: $!";