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"

include "cowgol.coh";
include "argv.coh";
 
ArgvInit();
var i: uint8 := 0;
 
loop
    var arg := ArgvNext();
    if arg == 0 as [uint8] then break; end if;
    i := i + 1;
    print_i8(i);
    print(": '");
    print(arg);
    print("'\n");
end loop;