Command-line arguments: Difference between revisions

m
→‎{{header|Phix}}: added p2js output
m (→‎{{header|Phix}}: added p2js output)
Line 1,825:
 
=={{header|Phix}}==
<!--<lang Phix>(phixonline)-->
<span style="color: #008080;">with</span> <span style="color: #008080;">javascript_semantics</span>
<span style="color: #008080;">constant</span> <span style="color: #000000;">cmd</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">command_line</span><span style="color: #0000FF;">()</span>
<span style="color: #0000FF;">?</span><span style="color: #000000;">cmd</span>
Line 1,843 ⟶ 1,844:
When compiled, the first two elements are instead {executable,executable}, so the parameters (if any) are consistently the 3rd element onwards.
{{out}}
desktop/Phix (Windows, Linux would be fairly similar but obviously with different paths):
<pre>
C:\Program Files (x86)\Phix>p testcl -c "alpha beta" -h "gamma"
Line 1,869 ⟶ 1,871:
#6 : gamma
C:\Program Files (x86)\Phix>
</pre>
pwa/p2js: No apologies from me for the gibberish in user agent strings these days, most of which I've manually trimmed away/replaced with "..)...".<br>
There isn't really a command line, and in fact command_line() within a browser always returns a result of exactly length 2.
<pre>
{"Mozilla/5.0 (Windows NT 10.0; WOW64..)...","file:///C:/Program%20Files%20(x86)/Phix/pwa/test.htm"}
Interpreted (using Mozilla/5.0 (Windows NT 10.0; WOW64..)...) source name: file:///C:/Program%20Files%20(x86)/Phix/pwa/test.htm
</pre>
 
7,805

edits