Command-line arguments is part of Short Circuit's Console Program Basics selection.
Scripted main
See also Program name.

For parsing command line arguments intelligently, see Parsing command-line arguments.

Example command line:

myprogram -c "alpha beta" -h "gamma"

MODULE try;
 
FROM  Arguments  IMPORT  GetArgs, ArgTable, GetEnv;
FROM  InOut      IMPORT  WriteCard, WriteLn, WriteString;
 
VAR   count, item        : SHORTCARD;
      storage            : ArgTable;
 
BEGIN
   GetArgs (count, storage);
   WriteString ('Count =');     WriteCard (count, 4);   WriteLn;
   item := 0;
   REPEAT
      WriteCard (item, 4);
      WriteString (' :  ');
      WriteString (storage^ [item]^);
      WriteLn;
      INC (item)
   UNTIL item = count
END try.