DIRECTORY BasicTime USING [GMT, nullGMT], Commander USING [CommandProc, Handle, Register], Convert USING [RopeFromCard, RopeFromTime], FingerOps, IO USING [BreakProc, EndOfStream, GetTokenRope, NUL, PutRope, RIS, SP, STREAM], Rope USING [Cat, Length, ROPE]; FingerCmd: CEDAR MONITOR IMPORTS Commander, Convert, FingerOps, IO, Rope = BEGIN fingerErrorCode: FingerOps.Reason; PerformFingerAtExec: ENTRY Commander.CommandProc = BEGIN ENABLE BEGIN IO.EndOfStream => CONTINUE; FingerOps.FingerError => { fingerErrorCode _ reason; GOTO FingerProblem }; END; Break: IO.BreakProc = BEGIN RETURN[IF char IN [IO.NUL..IO.SP] THEN sepr ELSE other] END; stream: IO.STREAM _ IO.RIS[cmd.commandLine]; actualName, plan, pictureFile: Rope.ROPE; data: FingerOps.ObjectData; WHILE TRUE DO -- stop when command line is exhausted and IO.EndOfStream is raised userNamePattern: Rope.ROPE _ IO.GetTokenRope[stream, Break].token; fingerResult: FingerOps.FingerList _ FingerOps.GetMatchingObjects[pattern: userNamePattern]; matches: CARDINAL _ 0; FOR list: FingerOps.FingerList _ fingerResult, list.rest WHILE list # NIL DO matches _ matches + 1 ENDLOOP; SELECT matches FROM 0 => IO.PutRope[cmd.out, Rope.Cat["\nThere were no matches on the pattern \"", userNamePattern, "\".\n"]]; 1 => IO.PutRope[cmd.out, Rope.Cat["\nThere was 1 match on the pattern \"", userNamePattern, "\":\n"]]; ENDCASE => IO.PutRope[cmd.out, Rope.Cat["\nThere were ", Convert.RopeFromCard[matches], " matches on the pattern \"", userNamePattern, "\":\n"]]; UNTIL fingerResult = NIL DO nextObject: FingerOps.FingerObject = fingerResult.first; [actualName, plan, pictureFile, data] _ FingerOps.GetProps[nextObject]; IO.PutRope[cmd.out, Rope.Cat["\n\"", nextObject.name, "\""]]; IF Rope.Length[actualName] > 0 THEN IO.PutRope[cmd.out, Rope.Cat[" (", actualName, ")"]]; IO.PutRope[cmd.out, Rope.Cat[" is a ", IF nextObject.type = person THEN "Person" ELSE "Machine"]]; IF nextObject.type = person THEN TRUSTED { WITH personData: data^ SELECT FROM person => {IF personData.mailRead # BasicTime.nullGMT THEN IO.PutRope[cmd.out, Rope.Cat["\n\tLast read mail at ", Convert.RopeFromTime[personData.mailRead]]]; FOR mList: LIST OF FingerOps.MachineData _ personData.used, mList.rest UNTIL mList = NIL DO IO.PutRope[cmd.out, Rope.Cat["\n\t", IF mList.first.operation = login THEN "Logged in to " ELSE "Logged out from ", mList.first.machine, " at ", Convert.RopeFromTime[mList.first.time]]] ENDLOOP} ENDCASE } ELSE TRUSTED { WITH machineData: data^ SELECT FROM machine => IO.PutRope[cmd.out, Rope.Cat["\n ", machineData.lastUser, IF machineData.operation = login THEN " Logged in to " ELSE " Logged out from ", nextObject.name, " at ", Convert.RopeFromTime[machineData.time]]]; ENDCASE }; IF Rope.Length[plan] > 0 THEN IO.PutRope[cmd.out, Rope.Cat["\n\tPlan: ", plan]]; IO.PutRope[cmd.out, "\n"]; fingerResult _ fingerResult.rest; ENDLOOP; IO.PutRope[cmd.out, "\n"]; ENDLOOP; EXITS FingerProblem => { IO.PutRope[cmd.out, SELECT fingerErrorCode FROM Aborted => "\n... Transaction Aborted; Retry Finger Operation", Error => "\n... Internal Finger Error; Contact Implementor", Failure => "\n... Connection with server broken; try again later", ENDCASE => NIL ] }; END; Commander.Register[key: "Finger", proc: PerformFingerAtExec, doc: "Perform a finger." ]; END. ΌFingerCmd.mesa Last edited by: Donahue, October 22, 1984 9:37:40 am PDT output results Register commands with the Exec to perform finger and create an instance of the Finger Tool. Κδ– "cedar" style˜code– "Cedar" style™K™8—K™šΟk ˜ Kšœ œ˜Kšœ œ!˜0Kšœœ˜+Kšœ ˜ Kš œœ(œ œœœ˜OKšœœœ˜—K˜šœ œ˜K˜š˜Kšœœ˜)K˜—š˜K˜K˜"K˜šœœ˜2š˜š˜š˜Kšœœ˜šœ˜Kšœœ˜/——Kšœ˜—šœœ ˜š˜Kšœœœœœœœœœ˜7—Kšœ˜—Kš œœœœœ˜,Kšœ$œ˜)K˜šœœœΟcC˜QKšœœœ#˜BKšœ\˜\Kšœ œ˜šœ6œœ˜LKšœ˜—Kšœ˜šœ ˜Kšœœc˜jKšœœ_˜fJšœœ„˜‘—šœœ˜Kšœ8˜8KšœG˜GKšœ™Kšœ;˜=Kšœœœ3˜YKšœ%œœ œ ˜bšœœœ˜*šœœ˜"K˜ šœœ)˜0Kšœa˜c—š œœœ5œ œ˜[Kšœ#œœœZ˜ΉKšœ˜—Kš˜Kšœ˜——šœœ˜šœœ˜#K˜ Kšœ:œœœX˜ΟKš˜—Kšœ˜—Kšœœœ1˜QKšœ˜Kšœ!˜!—Kšœ˜Kšœ˜—Kšœ˜šœ˜šœ˜Kšœ˜Kšœ?˜?Kšœ<˜