summaryrefslogtreecommitdiff
path: root/dis
diff options
context:
space:
mode:
Diffstat (limited to 'dis')
-rw-r--r--dis/charon/build.disbin38649 -> 38662 bytes
-rw-r--r--dis/charon/ftp.disbin3901 -> 3907 bytes
-rw-r--r--dis/charon/jscript.disbin51004 -> 50995 bytes
-rw-r--r--dis/charon/lex.disbin13350 -> 13338 bytes
-rw-r--r--dis/lib/complete.disbin0 -> 1142 bytes
-rwxr-xr-xdis/man114
-rw-r--r--dis/man.disbin2707 -> 0 bytes
7 files changed, 114 insertions, 0 deletions
diff --git a/dis/charon/build.dis b/dis/charon/build.dis
index d879669a..5426c965 100644
--- a/dis/charon/build.dis
+++ b/dis/charon/build.dis
Binary files differ
diff --git a/dis/charon/ftp.dis b/dis/charon/ftp.dis
index 55c1ba91..1be3f503 100644
--- a/dis/charon/ftp.dis
+++ b/dis/charon/ftp.dis
Binary files differ
diff --git a/dis/charon/jscript.dis b/dis/charon/jscript.dis
index e2d8a726..20f9696f 100644
--- a/dis/charon/jscript.dis
+++ b/dis/charon/jscript.dis
Binary files differ
diff --git a/dis/charon/lex.dis b/dis/charon/lex.dis
index 428d7d27..a7c38467 100644
--- a/dis/charon/lex.dis
+++ b/dis/charon/lex.dis
Binary files differ
diff --git a/dis/lib/complete.dis b/dis/lib/complete.dis
new file mode 100644
index 00000000..5feb01bc
--- /dev/null
+++ b/dis/lib/complete.dis
Binary files differ
diff --git a/dis/man b/dis/man
new file mode 100755
index 00000000..ebd13f4f
--- /dev/null
+++ b/dis/man
@@ -0,0 +1,114 @@
+#!/dis/sh.dis
+# Plan 9 man script adaptation for Inferno
+# for more details see the real man(1)
+load std
+
+fils=''
+cmd=n
+sec=()
+S=/man
+d=0
+
+x=$* # see sh(1) for details about s/$*/$x/.
+x=`{echo $x|tr A-Z a-z|tr -dc 'a-z0-9_ \012-/'} # fold case, delete funny chars
+
+search=yes
+while {~ $d 0}{
+ #echo d$d search$search cmd$cmd fils$fils: $"x
+ if {no $x}{
+ echo 'Usage: man [-bnSwpf] [0-9] [0-9] ... name1 name2 ...'
+ exit
+ }
+ if{ftest -d $S/${hd $x}}{
+ sec=($sec ${hd $x}); x=${tl $x};
+ }{
+ if{~ ${hd $x} '-n'}{
+ cmd=n; x=${tl $x};
+ }{~ ${hd $x} '-w'}{
+ cmd=w; x=${tl $x};
+ }{~ ${hd $x} '-b'}{
+ cmd=b; x=${tl $x};
+ }{~ ${hd $x} '-p'}{
+ cmd=p; x=${tl $x};
+ }{~ ${hd $x} '-s'}{
+ search=no; x=${tl $x};
+ }{~ ${hd $x} '-f'}{
+ search=no; x=${tl $x};
+ if {ftest -f ${hd $x}}{
+ fils=(${hd $x});
+ }{
+ echo 'man: bad option -f '${hd $x}
+ exit 'no file'
+ }
+ }{
+ d=1;
+ }
+
+ if{no $x}{
+ d=1;
+ }
+ }
+}
+if{no $sec} {
+ sec=`{ls -pd $S/[0-9]* }
+}
+
+ix=$S/$sec/INDEX
+if{~ $#x 1} {pat='^'^$x^' '}
+{pat='^('^`{echo $x | sed 's/ /|/g'}^') '}
+
+if{~ $search yes} {
+ for i in $S/$sec {
+ if {ftest -f $i/INDEX}{
+ try=`{grep -i $pat $i/INDEX | sed 's/^[^ ]*//'}
+ if {! no $try}{
+ fils=($fils $i/$try)
+ }
+ }
+ }
+}
+
+if{no $fils} {
+ # nothing in INDEX. try for file or given name
+ for i in $x {
+ if{~ $i intro} {i=0intro}
+ for n in $sec {
+ try=`{echo $S/$n/$i | tr A-Z a-z}
+ if {ftest -f $try} {
+ fils=($fils $try)
+ }
+ }
+ }
+ if{~ $#fils 0} {
+ echo 'man: no manual page'
+ exit 'no man'
+ }
+}
+
+for i in $fils {
+ if {~ $i ''}{
+ #echo bug ignore ''
+ }{! ftest -f $i}{
+ echo need:$i
+ }{
+ if {~ $cmd n}{
+ man2txt $i
+ }{~ $cmd w}{
+ echo $i
+ }{~ $cmd p}{
+ wm/man -f $i
+ }{~ $cmd b}{
+ if{~ $i '/man/*/*'}{
+ x=`{echo $i | sed 's;/man/(.*)/(.*);\1 \2;'}
+ if{~ ${index 2 $x} 0intro}{
+ x=(${index 1 $x} intro)
+ }
+ }{ x=($i ''); }
+
+ man2txt $i |
+ plumb -i -d edit -a action showdata -a filename '/man/'^${tl $x}^'('^${hd $x}^')'
+
+ }
+ }
+
+}
diff --git a/dis/man.dis b/dis/man.dis
deleted file mode 100644
index c8af50b8..00000000
--- a/dis/man.dis
+++ /dev/null
Binary files differ