RosettaCodeData/Task/Command-line-arguments/Phix/command-line-arguments.phix

14 lines
337 B
Plaintext

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