#!/usr/bin/perl -w
+# Usages:
+# ./farnell-find.pl NNN-NNNN
+# Prints info about the specified relevant part.
+# ./farnell-find.pl <file> [<sort>...]
+# Processes input file <file> and sorts output according to
+# <sort> (several may be specified). <sort>s can be `desc'
+# `avail' `price' (first mentioned is most significant.
+# Default sort order is `avail price desc'.
+#
# Input format: lines, #-comments, blank lines ignored.
# Indent level is relevant, but only 0, 1, >1 relevant.
#
-# Usages:
-# TBD
-#
# <Circuit Name>
# Starts a circuit.
# Circuit names must start with an uppercase letter.
} elsif (@ARGV>=1) {
my ($filename);
($filename, @sorthow) = @ARGV;
- @sorthow= qw(avail price) if !@sorthow;
+ push @sorthow, qw(avail price desc);
open F, "< $filename" or die $!;
read_spec();
close F or die $!;