Parse command-line arguments: Difference between revisions

Content added Content deleted
Line 441: Line 441:
}
}
</lang>
</lang>
Usage in shell:

<lang shell>
WARNING: This is reinventing the wheel to an extreme degree.
$> function -c --w arg1 arg2
</lang>
Note that this works in Powershell. All of the arguments after the function name will be passed as strings to the function, which then calls them as an array with the automatic variable, $args. The custom parser/function does the work from there, turning the strings into flags and typed arguments. WARNING: This is reinventing the wheel to an extreme degree.


=={{header|Racket}}==
=={{header|Racket}}==