chiark / gitweb /
document usage
authorian <ian>
Wed, 14 Apr 2004 19:50:21 +0000 (19:50 +0000)
committerian <ian>
Wed, 14 Apr 2004 19:50:21 +0000 (19:50 +0000)
farnell/farnell-find

index 779aea100a1c4b3f2a81f4c2b457e0e3f08ba12a..7eb890923adae3634525501b949fda5f852ccabd 100755 (executable)
@@ -1,11 +1,17 @@
 #!/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.
@@ -412,7 +418,7 @@ if (@ARGV==1 && $ARGV[0] =~ m/^\d\d\d\-/) {
 } 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 $!;