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"

% This program needs to be merged with PCLU's "useful.lib",
% where get_argv lives.
%
% pclu -merge $CLUHOME/lib/useful.lib -compile cmdline.clu
 
start_up = proc ()
    po: stream := stream$primary_output()
 
    args: sequence[string] := get_argv()
 
    for arg: string in sequence[string]$elements(args) do
        stream$putl(po, "arg: " || arg)
    end
end start_up