=================================================================== RCS file: /home/cvs/OpenXM/src/k097/Doc/genhelp.k,v retrieving revision 1.1 retrieving revision 1.2 diff -u -p -r1.1 -r1.2 --- OpenXM/src/k097/Doc/genhelp.k 2001/01/04 12:29:32 1.1 +++ OpenXM/src/k097/Doc/genhelp.k 2001/01/08 05:26:50 1.2 @@ -1,49 +1,78 @@ -/* $OpenXM$ */ +/* $OpenXM: OpenXM/src/k097/Doc/genhelp.k,v 1.1 2001/01/04 12:29:32 takayama Exp $ */ /* Todo - * Helplist should be sorted. - * Ex. should be removed. + * Example should be rewrited to Ex. * Args and references should be given in the Helplist. + See slib.k for the format of Helplist. + [ , , null, null,"short description"] No arg and no ( ), no reference. + [ , , ["a","b"],["Load_sm1"],"short description"] + [ , , [ ], null,"short description"] No arg, no reference. */ +/* It is for category == null */ def foo() { - local n,i,key,s,aaa,ref; + local n,i,j,key,s,aaa,ref,keys,shortDesc,category; Println("DO NOT EDIT THIS FILE. "); Println("It is AUTHOMATICALLY GENERATED."); sm1(" (cat standard-0.texi) system "); n = Length(Helplist); + keys = [" "]; /* This is a gate keeper for shell. */ + for (i=0; i< n; i++ ) { + category = Helplist[i,0]; + if (Tag(category) == 0) { + keys = Append(keys,Helplist[i,1,0]); + } + } + keys = sm1(keys," shell "); + n = Length(keys); + Println("/*&C "); Println("@menu "); - for (i=0; i 2) { - aaa = Helplist[i,2]; - ref = Helplist[i,3]; - }else{ - aaa = " (?) "; - ref = "Not yet written."; + for (j=1; j 2) { + if (Length(Helplist[i,1]) != 5) { + Stderr.Print(Helplist[i,1]); + Stderr.Println(" has a bad format. "); + Error("Stop by an error."); + } + aaa = Helplist[i,1,2]; + ref = Helplist[i,1,3]; + shortDesc = Helplist[i,1,4]; + }else{ + aaa = " (?) "; + ref = "Not yet written."; + shortDesc = " "; + } + break; + } + i++; } - printItem(key,s,aaa,ref); + printItem(key,s,aaa,ref,shortDesc); } sm1(" (cat standard-1.texi) system "); } -def printItem(key,s,aaa,ref) { - local desc,example; +def printItem(key,s,aaa,ref,shortDesc) { + local desc,example,i,shortDesc; desc = splitExample(s); Println("/*&en "); @@ -56,8 +85,26 @@ def printItem(key,s,aaa,ref) { Print("@subsection @code{"); Print(key); Println("}"); Print("@findex "); Println(key); Println("@table @t"); - Print("@item "); Print(key); Println(aaa); - Print(":: "); Println(desc[0]); + Print("@item "); Print(key); + if (Tag(aaa) != 0) { + if (IsArray(aaa)) { + Print(AsciiToString(LeftBracket)); /* ( */ + if (Length(aaa) >0) { + for (i=0; i 0) { + for (i=0; i */ + at = 64; /* @ */ + ex0 = StringToAsciiArray("Ex."); s = StringToAsciiArray(s); n = Length(s); + s = Join(s,[0,0,0,0]); ans = [ ]; - for (i=0; i