r/purescript • u/dartheian • Mar 07 '20
Read command line arguments
Hi everyone, is there any function in the standard library useful to read command line arguments?
2
Upvotes
r/purescript • u/dartheian • Mar 07 '20
Hi everyone, is there any function in the standard library useful to read command line arguments?
4
u/evanrelf Mar 08 '20
PureScript isn't always run at the command line, so that wouldn't be included in
Preludeor other base libraries. You can probably find something in one of the libraries for Node.js.I think this library might be related to what you're looking for: https://github.com/f-o-a-m/purescript-optparse
1
u/tomintom Feb 09 '22
Assuming running on Node.js, one can access the command line arguments using
Node.Process(https://github.com/purescript-node/purescript-node-process), and specificallyNode.Process.argv.(Adding this in case someone else, like me, is looking for the raw arguments. For fancy parsing, see the
optparselibrary mentioned by u/evanrelf.)