UserProfileCommandsImpl.mesa
Copyright Ó 1990, 1991 by Xerox Corporation. All rights reserved.
Michael Plass, February 6, 1990 11:18:29 am PST
DIRECTORY Commander, CommanderOps, IO, Rope, UserProfile;
UserProfileCommandsImpl: CEDAR PROGRAM
IMPORTS Commander, CommanderOps, IO, Rope, UserProfile
~ BEGIN
ROPE: TYPE ~ Rope.ROPE;
CommandsFromProfileCommand: Commander.CommandProc = {
FOR initialKey: ROPE ¬ CommanderOps.NextArgument[cmd], CommanderOps.NextArgument[cmd] UNTIL initialKey = NIL DO
initial: ROPE ~ UserProfile.Line[initialKey];
IF initial # NIL THEN {
hadFailure: BOOL ¬ CommanderOps.ReadEvalPrintLoop[
CommanderOps.CreateFromStreams[in: IO.RIS[initial], parentCommander: cmd]
];
IF hadFailure THEN {
ERROR CommanderOps.Failed[Rope.Cat["[[Command failed during processing of CommandsFromProfile ", initialKey,"]]"]];
};
};
ENDLOOP;
};
Commander.Register[key: "CommandsFromProfile", proc: CommandsFromProfileCommand, doc: "Execute commands from a user profile entry\nUsage: CommandsFromProfile key ..."];
END.