userNamePattern: Rope.ROPE ← IO.GetTokenRope[stream, Break].token;
fingerResult: FingerOps.FingerList ← FingerOps.GetMatchingObjects[pattern: userNamePattern];
SELECT matches
FROM
0 => IO.PutRope[cmd.out, Rope.Cat["\nThere were no matches on the username pattern \"", userNamePattern, "\".\n"]];
1 => IO.PutRope[cmd.out, Rope.Cat["\nThere was 1 match on the username pattern \"", userNamePattern, "\":\n"]];
ENDCASE => IO.PutRope[cmd.out, Rope.Cat["\nThere were ", Convert.RopeFromCard[matches], " matches on the username pattern \"", userNamePattern, "\":\n"]];
UNTIL fingerResult =
NIL
DO
nextObject: FingerOps.FingerObject = fingerResult.first;
[actualName, plan, pictureFile] ← FingerOps.GetProps[nextObject];
output results
IO.PutRope[cmd.out, Rope.Cat["\t\"", 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 {
machineList: LIST OF Rope.ROPE;
[machineList, time] ← FingerOps.GetUserData[nextObject.name];
IF time # BasicTime.nullGMT
THEN
IO.PutRope[cmd.out, Rope.Cat["\n Last read mail at ", Convert.RopeFromTime[time]]];
FOR mList:
LIST
OF Rope.
ROPE ← machineList, mList.rest
UNTIL mList =
NIL
DO
[lastOp ~ operation, time ~ time] ← FingerOps.GetMachineData[mList.first];
IO.PutRope[cmd.out, Rope.Cat["\n ", IF operation = login THEN "Logged in to " ELSE "Logged out from ", mList.first, " at ", Convert.RopeFromTime[time]]]
ENDLOOP
}
ELSE {
[lastOp ~ operation, time ~ time, user ~ user] ← FingerOps.GetMachineData[nextObject.name];
IO.PutRope[cmd.out, Rope.Cat["\n ", user, IF operation = login THEN " Logged in to " ELSE " Logged out from ", nextObject.name, " at ", Convert.RopeFromTime[time]]]
};
IF Rope.Length[plan] > 0 THEN IO.PutRope[cmd.out, Rope.Cat["\nPlan: ", plan]];
IO.PutRope[cmd.out, "\n"];
fingerResult ← fingerResult.rest;