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"

with javascript_semantics
constant cmd = command_line()
?cmd
if cmd[1]=cmd[2] then
    printf(1,"Compiled executable name: %s\n",{cmd[1]})
else
    printf(1,"Interpreted (using %s) source name: %s\n",cmd[1..2])
end if
if length(cmd)>2 then
  puts(1,"Command line arguments:\n")
  for i = 3 to length(cmd) do
    printf(1,"#%d : %s\n",{i,cmd[i]}) 
  end for
end if
