How do I detect what command line arguments where given when a script is run with racket? That is, the equivalent of sys.argv in Python, args[] in Java, etc…
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You have these choices (you can look them all up in the docs for more info):
current-command-line-arguments— a vector holding the command line argumentsYou can start a script with the
-mflag, which will require the file and look for a providedmainfunction, then apply it on the command-line arguments (as a list of strings)Or you can require
racket/cmdlinewhich provides a macro that can be used to define several flags in a convenient way.