From: ian Date: Wed, 14 Apr 2004 19:50:21 +0000 (+0000) Subject: document usage X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=bdbbe2d767d19aeaec2e1ebb010f8dc4433551f3;p=trains.git document usage --- diff --git a/farnell/farnell-find b/farnell/farnell-find index 779aea1..7eb8909 100755 --- a/farnell/farnell-find +++ b/farnell/farnell-find @@ -1,11 +1,17 @@ #!/usr/bin/perl -w +# Usages: +# ./farnell-find.pl NNN-NNNN +# Prints info about the specified relevant part. +# ./farnell-find.pl [...] +# Processes input file and sorts output according to +# (several may be specified). 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 -# # # 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 $!;