CopyFromKbdCmd: Commander.CommandProc = {
[cmd: Commander.Handle] RETURNS [result: REF ANY ← NIL, msg: ROPE ← NIL]
stopChar, c: CHAR;
stopStr: Rope.ROPE;
fileName: Rope.ROPE;
s: IO.STREAM;
IF ~CommandTool.NextArgument[cmd].Equal["-q"]
THEN
RETURN[$Failure, "Usage: CopyFromKbd -q <switch> <fileName>"];
stopStr ← CommandTool.NextArgument[cmd];
stopChar ← IF stopStr=NIL THEN 'Z ELSE stopStr.Fetch[0];
IF stopChar >= 'a THEN stopChar ← stopChar - ('a - 'A);
IF stopChar >= 'A THEN stopChar ← LOOPHOLE[(stopChar - 'A) + 1];
fileName ← CommandTool.NextArgument[cmd];
IF fileName=NIL THEN RETURN[$Failure, "Usage: CopyFromKbd -q <switch> <fileName>"];
s ← FS.StreamOpen[fileName, $create];
WHILE (c𡤌md.in.GetChar[])#stopChar DO s.PutChar[c]; ENDLOOP;
s.Close[];
};