summaryrefslogtreecommitdiff
path: root/ipl/progs/limitf.icn
blob: 91d0a203aee0234c0fad325fffbc2a40c85a3b57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
############################################################################
#
#	File:     limitf.icn
#
#	Subject:  Program to limit throughput
#
#	Author:   Ralph E. Griswold
#
#	Date:     September 17, 1998
#
############################################################################
#
#  This file is in the public domain.
#
############################################################################
#
#  This program is intended to be used in a pipe line.  It passes through
#  at most the number of line given by the command-line option -l (default
#  10). 
#
############################################################################
#
#  Links:  options
#
############################################################################

link options

procedure main(args)
   local opts, limit

   opts := options(args, "l+")

   limit := \opts["l"] | 10

   every write(!&input) \ limit

end