Command-line arguments: Difference between revisions

Add Draco
m (Fix header)
(Add Draco)
Line 835:
 
The order of command line ''options'' is lost.
 
=={{header|Draco}}==
Draco comes with a library function that will return each command line argument
in turn. It simply splits the command line on whitespace, and does not support
quotes.
 
In the example below, the arguments are additionally all made uppercase.
This is however a limitation of the CP/M operating system, and not of Draco.
 
<lang draco>\util.g
 
proc nonrec main() void:
*char par;
word i;
i := 0;
while par := GetPar(); par ~= nil do
i := i + 1;
writeln(i:3, ": '", par, "'")
od
corp</lang>
 
{{out}}
 
<pre>A>param -c "alpha beta" -h "gamma"
1: '-C'
2: '"ALPHA'
3: 'BETA"'
4: '-H'
5: '"GAMMA"'</pre>
 
=={{header|E}}==
2,114

edits