]> git.lizzy.rs Git - plan9front.git/blob - acme/bin/aspell
exec(2): fix prototypes
[plan9front.git] / acme / bin / aspell
1 #!/bin/rc
2
3 spellflags=()
4 fflag=''
5 for(x){
6         switch($x){
7         case -[bcvx]
8                 spellflags=($spellflags $x)
9         case -f
10                 fflag=$x
11         case *
12                 if(~ $fflag -f) {
13                         spellflags=($spellflags -f $x)
14                         fflag=''
15                 }
16                 if not args = ($args $x)
17         }
18 }
19
20 dir = /mnt/wsys
21 if(! test -f $dir/cons)
22         dir = /mnt/term/$dir
23 id=`{cat $dir/new/ctl}
24 id=$id(1)
25
26 if(~ $#args 1 && ~ $args /*){
27         adir = `{basename -d $args}
28         args = `{basename $args}
29         echo 'name '^$adir^/-spell > $dir/$id/ctl
30         cd $adir
31 }
32 if not {
33         echo 'name '^`{pwd}^/-spell > $dir/$id/ctl
34 }
35
36 {
37         echo noscroll
38         if(~ $#args 0)
39                 /acme/bin/$cputype/spout | sort  -t: -u +2 | sort  -t: +1.1n | aux/sprog -a $spellflags > $dir/$id/body
40         if not for(i in $args)
41                 /acme/bin/$cputype/spout $i | sort  -t: -u +2 | sort  -t: +1.1n | aux/sprog -a $spellflags > $dir/$id/body
42         echo clean
43 }> $dir/$id/ctl