Command-line arguments: Difference between revisions
Content added Content deleted
(Added C3) |
imported>Brie (Add Nu) |
||
Line 1,857: | Line 1,857: | ||
for arg in commandLineParams(): |
for arg in commandLineParams(): |
||
echo arg</syntaxhighlight> |
echo arg</syntaxhighlight> |
||
=={{header|Nu}}== |
|||
In Nu, the special <code>main</code> function can be declared, which gets passed the cli arguments. |
|||
<syntaxhighlight lang="nu"> |
|||
def main [...argv] { |
|||
$argv | print |
|||
} |
|||
</syntaxhighlight> |
|||
{{out}} |
|||
<pre> |
|||
~> nu cli.nu A B C "Hello World!" |
|||
╭───┬──────────────╮ |
|||
│ 0 │ A │ |
|||
│ 1 │ B │ |
|||
│ 2 │ C │ |
|||
│ 3 │ Hello World! │ |
|||
╰───┴──────────────╯ |
|||
</pre> |
|||
=={{header|Oberon-2}}== |
=={{header|Oberon-2}}== |