summaryrefslogtreecommitdiff
path: root/web/noweb/src/shell/notangle
blob: ba3174e4bec55c6a2388d3db08cee4bdd11b08e3 (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
#!/bin/sh
# Copyright 1991 by Norman Ramsey.  All rights reserved.
# See file COPYRIGHT for more information.
# $Id: notangle.nw,v 1.2 1997/09/13 20:29:56 nr Exp $
# $Name:  $
LIB=|LIBDIR|
markup=$LIB/markup opt= arg= markopt= filters=
while [ $# -gt 0 ]; do
        case $1 in
        -ml|-m3|-awk|-icn|-icon|-pascal|-c|-c++|-f77|-f90|-tex|-w[0-9][0-9]*) ;; 
                                        # deliberately ignore nountangle args
        -t)  ;; # this is default
        -t*) markopt="$markopt -t" ; opt="$opt '$1'" ;;
                # copy tabs at markup, use width given in notangle
        -filter) filters="$filters $2 | " ; shift ;;
        -markup) markup="$2" ; shift ;;
        -)   arg="$arg '$1'" ;;
        -L*) opt="$opt -t '$1'" ; markopt="$markopt -t" ;;
        -*)  opt="$opt '$1'" ;;
        *)   arg="$arg '$1'" ;;
        esac
        shift
done
PATH="$PATH:$LIB" 
export PATH
eval "$markup $markopt $arg | $filters $LIB/nt $opt "'; rc=$?'
exit $rc