From e92f458b860252563dec03bdfde2ba7a6da37a95 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Wed, 23 Mar 2011 17:42:37 -0300 Subject: [PATCH] fpd2pdf/fpdoc: added option -a module to manually add modules - fpdoc (usage, main): new option -a module to add modules - fpdoc: separated availability checking from mapping of component references to modules --- fpd2pdf/fpdoc | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/fpd2pdf/fpdoc b/fpd2pdf/fpdoc index a8d47cd..24e00d2 100755 --- a/fpd2pdf/fpdoc +++ b/fpd2pdf/fpdoc @@ -14,11 +14,19 @@ sub usage { - print STDERR "usage: $0 pro-file pdf-file\n"; + print STDERR "usage: $0 [-a module ...] pro-file pdf-file\n\n"; + print STDERR " -a module add the specified module\n"; exit(1); } +while ($ARGV[0] eq "-a") { + shift(@ARGV); + &usage unless @ARGV; + $need{shift @ARGV} = 1; +} + +&usage if $ARGV[0] =~ /^-/; &usage unless @ARGV == 2; $pro = $ARGV[0]; @@ -61,9 +69,11 @@ do "pos2fab" || die "pos2fab: $!"; # for (@order) { - my $fp = $fp{$_}; - die "don't have $fp" unless defined $fpd{$fp}; - $need{$fp} = 1; + $need{$fp{$_}} = 1; +} + +for (keys %need) { + die "don't have $_" unless defined $fpd{$_}; } exec "fpd2pdf", "-o", $out, map { "$fpd{$_}:$_" } sort keys %need;