1 (* Library module defined by the International Standard
2 Information technology - programming languages
3 BS ISO/IEC 10514-1:1996E Part 1: Modula-2, Base Language.
5 Copyright ISO/IEC (International Organization for Standardization
6 and International Electrotechnical Commission) 1996-2021.
8 It may be freely copied for the purpose of implementation (see page
9 707 of the Information technology - Programming languages Part 1:
10 Modula-2, Base Language. BS ISO/IEC 10514-1:1996). *)
12 DEFINITION MODULE ProgramArgs;
14 (* Access to program arguments *)
19 ChanId = IOChan.ChanId;
21 PROCEDURE ArgChan (): ChanId;
22 (* Returns a value that identifies a channel for reading
25 PROCEDURE IsArgPresent (): BOOLEAN;
26 (* Tests if there is a current argument to read from. If not,
27 read <= IOChan.CurrentFlags() will be FALSE, and attempting
28 to read from the argument channel will raise the exception
33 (* If there is another argument, causes subsequent input from the
34 argument device to come from the start of the next argument.
35 Otherwise there is no argument to read from, and a call of
36 IsArgPresent will return FALSE.